const File = brackets.getModule("filesystem/File")Kind: global class
Model for a File.
This class should not be instantiated directly. Use FileSystem.getFileForPath, FileSystem.resolve, or Directory.getContents to create an instance of this class.
See the FileSystem class for more details.
| Param | Type | Description |
|---|---|---|
| fullPath | string |
The full path for this File. |
| fileSystem | FileSystem |
The file system associated with this File. |
Read a file.
Kind: instance method of File
| Param | Type | Description |
|---|---|---|
| options | Object |
|
| [options.encoding] | string |
'one of format supported here: https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/encoding' |
| [options.ignoreFileSizeLimits] | boolean |
by default max file size that can be read is 16MB. |
| [options.doNotCache] | boolean |
will not cache if enabled. Auto-enabled if ignoreFileSizeLimits = true |
| callback | function |
Callback that is passed the FileSystemError string or the file's contents and its stats. |
Write a file.
Kind: instance method of File
| Param | Type | Description |
|---|---|---|
| data | string |
Data to write. |
| [options] | Object |
properties {encoding: 'one of format supported here: https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder/encoding'} |
| [callback] | function |
Callback that is passed the FileSystemError string or the file's new stats. |