Constructor
new Filesystem(settingsopt) → {Filesystem}
Synchronize an Actor with a local filesystem.
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
settings |
Object |
<optional> |
Configuration for the Fabric filesystem.
Properties
|
- Source:
Returns:
Instance of the Fabric filesystem.
- Type
- Filesystem
Methods
_loadFromDisk() → {Promise}
Load Filesystem state from disk.
- Source:
Returns:
Resolves with Filesystem instance.
- Type
- Promise
ls() → {Array}
Get the list of files.
- Source:
Returns:
List of files.
- Type
- Array
readFile(name) → {Buffer}
Read a file by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the file to read. |
- Source:
Returns:
Contents of the file.
- Type
- Buffer
(async) sync() → {Filesystem}
Syncronize state from the local filesystem.
- Source:
Returns:
Instance of the Fabric filesystem.
- Type
- Filesystem
writeFile(name, content) → {Boolean}
Write a file by name.
Parameters:
Name | Type | Description |
---|---|---|
name |
String | Name of the file to write. |
content |
Buffer | Content of the file. |
- Source:
Returns:
`true` if the write succeeded, `false` if it did not.
- Type
- Boolean