File

Description

Classes Summary

Classes

Constructor

File

fullPath string
The full path for this File.
fileSystem FileSystem
The file system associated with this File.
Properties
Methods

Properties

Private

_contents

Cached contents of this file. This value is nullable but should NOT be undefined.

Private

_hash

Consistency hash for this file. Reads and writes update this value, and writes confirm the hash before overwriting existing files. The type of this object is dependent on the FileSystemImpl; the only constraint is that === can be used as an equality relation on hashes.

Methods

Private

_clearCachedData

Clear any cached data for this file. Note that this explicitly does NOT clear the file's hash.

read

Read a file.

options optional Object
Currently unused.
callback function (?string,string=,FileSystemStats=)
Callback that is passed the FileSystemError string or the file's contents and its stats.

write

Write a file.

data string
Data to write.
options optional object
Currently unused.
callback optional function (?string, FileSystemStats=)
Callback that is passed the FileSystemError string or the file's new stats.