File System APIs
The File System APIs (api.fs) provide access to a set of methods with permissions such as read, write, and delete files/directories.
Note
The host application creates a root directory for each plugin. Therefore, each API method operates on a relative path.
readDir
Reads the list of files from a directory.
Method |
| ||||||
Parameters |
| ||||||
Returns |
| ||||||
Throws | Throws error if the path format is invalid. |
readFile
Reads file content from provided relative path.
Method |
| ||||||
Parameters |
| ||||||
Returns |
| ||||||
Throws | Throws error if the path format is invalid. |
unlink
Removes a file from the file system.
Method |
| ||||||
Parameters |
| ||||||
Returns |
| ||||||
Throws | Throws error if the path format is invalid. |
writeFile
Writes content to a file. Creates a new file if one does not already exist. May either append to an existing file or overwrite with new content.
Method |
| ||||||||||||
Parameters |
| ||||||||||||
Returns |
| ||||||||||||
Throws | Throws error if for an invalid path format |