fs
Works with filesytem.
Declared types
tfilestat: (size: int, attr: int)
List of constants
Name | Type | Description |
---|---|---|
fa_invalid | -1 | |
fa_readonly | 1 | |
fa_hidden | 2 | |
fa_sysfile | 4 | |
fa_directory | 16 | |
fa_archive | 32 |
Functions
1. fs::absPath
Returns canonicalized absolute pathname from given string.
Type definition
func(path: string -> string)
List of arguments
Name | Type | Description |
---|---|---|
path | string | Initial path |
List of results
Name | Type | Description |
---|---|---|
- | string | Absolute path |
2. fs::chDir
Changes current directory.
Type definition
func(path: string)
List of arguments
Name | Type | Description |
---|---|---|
path | string | New path |
List of results
This function returns no results
3. fs::close
Closes file handle.
Type definition
func(handle: int)
List of arguments
Name | Type | Description |
---|---|---|
handle | int | File handle |
List of results
This function returns no results
4. fs::delete
Deletes file from filesystem.
Type definition
func(path: string)
List of arguments
Name | Type | Description |
---|---|---|
path | string | Path to file to be deleted |
List of results
This function returns no results
5. fs::mkDir
Creates directories by given path.
Type definition
func(path: string)
List of arguments
Name | Type | Description |
---|---|---|
path | string | Path to create |
List of results
This function returns no results
6. fs::open
Opens file. If file does not exist it will be created. If no path specified in-memory file will be created.
Type definition
func(path: string -> int)
List of arguments
Name | Type | Description |
---|---|---|
path | string | Path to the file, pass empty string to create in-memory file |
List of results
Name | Type | Description |
---|---|---|
- | int | File handle |
7. fs::pwd
Returns current directory.
Type definition
func(-> string)
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | string | Current directory |
8. fs::rmDir
Deletes empty directory.
Type definition
func(path: string)
List of arguments
Name | Type | Description |
---|---|---|
path | string | Path of directory to be deleted |
List of results
This function returns no results
9. fs::scan
List files and directories inside the specified path.
Type definition
func(path: string -> dirs: list(string), files: list(string))
List of arguments
Name | Type | Description |
---|---|---|
path | string | Path to be scanned |
List of results
Name | Type | Description |
---|---|---|
dirs | list(string) | List of directories |
files | list(string) | List of files |
10. fs::stat
Returns file attributes and size.
Type definition
func(path: string -> tfilestat)
List of arguments
Name | Type | Description |
---|---|---|
path | string | Initial path |
List of results
Name | Type | Description |
---|---|---|
- | tfilestat | File size and attributes |