-
Notifications
You must be signed in to change notification settings - Fork 72
WWIV File and OS API (Proposal)
Rushfan edited this page Nov 5, 2020
·
5 revisions
package: wwiv.file
opt = wwiv.file.open_options("GFILES")
wwiv.file.open(opt, NAME, MODE)
- first option is location, and is one of:
- "GFILES": anything allowed
- "MENU": any *.ans, *.msg, *.b&w allowed
- NAME is filename
- MODE is "R" or "W" for read or write
- returns value a wwiv.file.handle.
s = wwiv.file.readintostring(handle)
- handle is a file handler created from wwiv.file.open
- returns all of the lines from handle as a string
l = list()
wwiv.file.readlines(handle, l)
- handle is a file handler created from wwiv.file.open
- l is an empty list
- reads all of the lines from handle into l
opt = wwiv.file.open_options("GFILES")
wwiv.file.last_modified(opt, NAME)
- returns the last modified time as a unix time_t value
package wwiv.os
opt = wwiv.os.exec_options("DOOR32", "TEMP", "chain.txt")
opt.type = "DOOR32"
opt.dropfile = "chain.txt"
opt.dir = "TEMP"
Options are (in order):
- TYPE (one of "DOOR32", "STDIO", "FOSSIL")
- DIR
- dir is one of
- "TEMP": Temp directory for node
- "BBS" : BBS Root Directory
- DROPFILE (one of "CHAIN.TXT", "DOOR.SYS")
wwiv.exec(opt, cmd)
- opt is an exec_options struture
- cmd is the commandline to execute.