From 50d47eba491421f8140fbb0505b700f9516d0a9e Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Tue, 1 Aug 2017 21:41:54 +1000 Subject: [PATCH] updated docs to reflect e39451b --- docs/api.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/docs/api.md b/docs/api.md index 1d2376e..b2ef61e 100644 --- a/docs/api.md +++ b/docs/api.md @@ -41,6 +41,18 @@ Reads *length* bytes of data from *handle*. *length* is usually limited to 2048. Writes *data* to *handle*. #### fs.readall(*handle*) Returns as much data as can be read from *handle*. +#### fs.list(*path*) +Returns a table of files contained in directory *path* +#### fs.mkdir(*path*) +Creates a directory at *path* +#### fs.rm(*path*) +Removes a file or (empty) directory at *path*. +#### fs.exists(*path*) +Returns true if a file or directory *path* exists. +#### fs.isdir(*path*) +Returns true if *path* is a directory. +#### fs.cd(*path*) +Changes the current directory to either *path* or *os.getenv("PWD")*/*path*. ### io #### write(...) or io.write(...) @@ -58,6 +70,18 @@ Writes *data* to *fobj* (if in write mode) ##### fobj:close() Closes *fobj*, flushing buffers and removing the object from memory. +### shutil +#### cd(*path*) +Alias to fs.cd +#### rm(*path*) +Alias to fs.rm +#### mkdir(*path*) +Alias to fs.mkdir +#### ls(*path*) +Wrapper for fs.list that prints the contents of *path*. +#### cat(*path*) +Prints the contents of the file *path*. + ### drivers #### tty(*gA*, *sA*, *sI*, *fg*, *bg*) Creates a GPU driver instance for GPU *gA* and screen *sA* attached to session *sI*, optionally with foreground and background colours *fg* and *bg*. @@ -80,3 +104,5 @@ This is triggered to make a tty driver attached to *session* write *text* to the ## Applications ### luash(*sI*) Spawns a luash instance for session *sI* +### skex("*fname*") +Launches an instance of the skex text editor, optionally reading *fname* at startup.