Updated documentation and improved fs-ext
This commit is contained in:
parent
78047ad297
commit
f03821ed86
28
doc/api.md
28
doc/api.md
@ -16,8 +16,34 @@ Displays its arguments on the display device as a string, with a newline.
|
||||
Displays its arguments on the display device as a string, without a newline
|
||||
## drivers/keyboard.lua
|
||||
This is a device-specific driver.
|
||||
### `readln()`
|
||||
### `input = readln()`
|
||||
Reads a line of input from the keyboard.
|
||||
## library/fs-min.lua
|
||||
fs-min implements basic filesystem resolution.
|
||||
### `fsproxy,path = fres(p)`
|
||||
Returns the proxy and path for that proxy for an input path `p`. Input paths have the form of `filesystem:/directory/file` or `/filesystem/directory/file`.
|
||||
## library/fs-std.lua
|
||||
fs-std implements file handles and methods for said file handles.
|
||||
### `handle = fopen(path, mode)`
|
||||
Opens a file handle for `path` with mode `mode`. File handle is for the OS, not the filesystem.
|
||||
### `fclose(handle)`
|
||||
Closes a file handle.
|
||||
### `data = fread(handle)`
|
||||
Reads data from a file handle `handle`.
|
||||
### `fwrite(handle,data)`
|
||||
Writes `data` to the handle `handle`.
|
||||
## library/fs-ext.lua
|
||||
fs-ext implements utility functions to do with filesystems.
|
||||
### `tdir = flist(path)`
|
||||
Returns a table of contents, `tdir` of a directory `path`
|
||||
### `fmkdir(path)`
|
||||
Creates the directory `path`.
|
||||
### `frm(path)`
|
||||
Deletes the file/directory `path`.
|
||||
### `fexists(path)`
|
||||
Returns true if the file/dir `path` exists.
|
||||
### `isdir = fisdir(path)`
|
||||
Returns whether the file/dir `path` is a directory.
|
||||
## library/net.lua
|
||||
Note: Settings have to be set in the kernel module, at the line
|
||||
```
|
||||
|
@ -14,3 +14,7 @@ function fexists(s)
|
||||
local d,p = fres(s)
|
||||
return d.exists(p)
|
||||
end
|
||||
function fisdir(s)
|
||||
local d,p = fres(s)
|
||||
return d.isDirectory(p)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user