Skip to content

RemoteZeroFS

Ivanq edited this page Oct 14, 2018 · 2 revisions

RemoteZeroFS constructor(ZeroPage page, String address)

Creates a new RemoteZeroFS instance from ZeroPage object.

The RemoteZeroFS object gives you access to filesystem of address site via CORS. The methods work the same way as in ZeroFS.

FS methods

Promise<String|Uint8Array> readFile(String file, "arraybuffer"|Boolean bytes=false, Boolean required=false)

Promise<String|Uint8Array> peekFile(String file, Number offset, Number length, "arraybuffer"|Boolean bytes)

Promise<Boolean> fileExists(String file)

Promise<Array<String>> readDirectory(String dir, Boolean recursive=false)

Promise<"file"|"dir"> getType(String file)

All work the same way as their ZeroFS analogues.

Stubs

Promise writeFile(String file, String|Uint8Array content, "arraybuffer"|Boolean bytes=false)

Promise deleteFile(String file)

Reject String("Remote FS cannot be changed").

Clone this wiki locally