Represents an individual file that can be watched, read from, and written to.
Creates the file on disk that corresponds to ::getPath()
if no
such file already exists.
Return values |
---|
Returns a Promise that resolves once the file is created on disk. It resolves to a boolean value that is true if the file was created or false if it already existed. |
Invoke the given callback when the file’s contents change.
Argument | Description |
---|---|
|
Function to be called when the file’s contents change. |
Return values |
---|
Returns a Disposable on which |
Invoke the given callback when the file’s path changes.
Argument | Description |
---|---|
|
Function to be called when the file’s path changes. |
Return values |
---|
Returns a Disposable on which |
Invoke the given callback when the file is deleted.
Argument | Description |
---|---|
|
Function to be called when the file is deleted. |
Return values |
---|
Returns a Disposable on which |
Invoke the given callback when there is an error with the watch. When your callback has been invoked, the file will have unsubscribed from the file watches.
Argument | Description |
---|---|
|
Function callback |
|
|
|
Object the error object |
|
Function call this to indicate you have handled the error. The error will not be thrown if this function is called. |
Return values |
---|
Returns a promise that resolves to a Boolean, true if the file exists, false otherwise. |
Sets the file’s character set encoding name.
Argument | Description |
---|---|
|
The String encoding to use (default: ‘utf8’) |
Return the String filename without any directory information.
Return the Directory that contains this file.
Overwrites the file with the given text.
Argument | Description |
---|---|
|
The String text to write to the underlying file. |
Return values |
---|
Returns undefined. |