fd: synchronous and asynchronous file descriptors
fd implements an API identical to lua's
file object but with support for
async operations following the
lib/lap protocol.
It also contains a few simple file-backed data structures (fd.VFile and
fd.LLFile).
filedescriptor: direct control of filedescriptors.
async operations support the LAP (see lib/lap) protocol.
Can override default `io` module for global async mode.
Functions
- fn isTrunc(mode) -> bool
Given a string mode, return whether the file will be truncated.
- fn isCreate(mode)
Given a string mode, return whether the file will be created
if it doesn't exist.
- fn newFD
- fn newFDT
- fn finishRunning(fd, kind, ...)
- fn modifiedEq(fs1, fs2)
return whether two fstat's have equal modification times
FIXME: move this to civix
- fn openWith(openFn, path, mode)
- fn openFD(...) -> M.openWith(S.openFD, ...)
- fn openFDT(...) -> M.openWith(S.openFDT, ...)
- fn open(...)
- fn close()
- fn tmpfileFn(sysFn)
- fn tmpfile() -> M.tmpfileFn(S.tmpFD)
- fn read(...)
- fn lines(path, mode)
- fn write(...) -> M.output():write(...)
- fn openFileno(fileno)
- fn input() -> M.stdin
- fn output() -> M.stdout
- fn flush() -> M.output():flush()
- fn type(fd)
- fn fileno(fd)
- fn ftype(f)
- fn isatty(fd)
- fn ioStd()
- fn ioSync()
- fn ioAsync()