Latite Scripting Documentation (Exports)
Exports > lib/clipboard > include > Filesystem
Interface
Source: lib/filesystem.d.ts:2
append(path:
string, data:Uint8Array):void
Source: lib/filesystem.d.ts:53
| Parameter | Type | Description |
|---|---|---|
| path | string |
The path to append to the file. |
| data | Uint8Array |
The data to append, for example, util.bufferToString("hello") |
void
createDirectory(path:
string):void
Creates a folder/directory.
Source: lib/filesystem.d.ts:46
| Parameter | Type | Description |
|---|---|---|
| path | string |
The path to create a directory. |
void
delete(path:
string):void
Source: lib/filesystem.d.ts:7
| Parameter | Type | Description |
|---|---|---|
| path | string |
The path of the file |
void
exists(path:
string):boolean
Checks if a file or a directory exists
Source: lib/filesystem.d.ts:40
| Parameter | Type | Description |
|---|---|---|
| path | string |
The path to check if a file or directory exists |
boolean
read(path:
string):Uint8Array
Reads a file from the path specified.
Source: lib/filesystem.d.ts:28
| Parameter | Type | Description |
|---|---|---|
| path | string |
The relative path from the script. |
Uint8Array
readAsync(path:
string, callback:Function):void
Reads a file asynchronously.
Source: lib/filesystem.d.ts:14
| Parameter | Type | Description |
|---|---|---|
| path | string |
The path to read from. |
| callback | (err: number, content: Uint8Array) => void |
This will get called when the operation is finished |
void
readDirectory(path:
string):string[]
Gets a list of the contents of a directory.
Source: lib/filesystem.d.ts:59
| Parameter | Type | Description |
|---|---|---|
| path | string |
The path to the directory. |
string[]
write(path:
string, data:Uint8Array):void
Writes a file to the path specified.
Source: lib/filesystem.d.ts:34
| Parameter | Type | Description |
|---|---|---|
| path | string |
The relative path from the script. |
| data | Uint8Array |
The data to write. For example, util.stringToBuffer("hello") |
void
writeAsync( path:
string, data:Uint8Array, callback:Function):void
Source: lib/filesystem.d.ts:22
| Parameter | Type | Description |
|---|---|---|
| path | string |
The path to write to |
| data | Uint8Array |
The data to write (see util.stringToBuffer to convert a string to a buffer) |
| callback | (err: number) => void |
This will get called when the operation is finished |
void