{{APIRef("File System API")}} {{non-standard_header}}
The File and Directory Entries API interface FileSystem
is used to represent a file system. Each object is passed to the success callback when requestFileSystem()
is called.
Because this is a non-standard API, whose specification is not currently on a standards track, it's important to keep in mind that not all browsers implement it, and those that do may implement only small portions of it. Check the {{anch("Browser compatibility")}} section for details.
Basic concepts
There are two ways to get access to a FileSystem
object: you can directly ask for one representing a sandboxed file system created just for your web app directly by calling window.requestFileSystem()
. If that call is successful, it executes a callback handler, which receives as a parameter a FileSystem
object describing the file system.
The FileSystem
object is your gateway to the entire API and you will use it a lot. So once you have a reference, it handy in a variable (either global or in an appropriate object property).
Properties
- {{domxref("FileSystem.name")}} {{ReadOnlyInline}}
- A {{domxref("DOMString")}} representing the file system's name. This name is unique among the entire list of exposed file systems.
- {{domxref("FileSystem.root")}} {{ReadOnlyInline}}
- A {{domxref("FileSystemDirectoryEntry")}} object which represents the file system's root directory. Through this object, you can gain access to all files and directories in the file system.
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('File System API')}} | {{Spec2('File System API')}} | Draft of proposed API |
This API has no official W3C or WHATWG specification.
Browser compatibility
{{ CompatibilityTable }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 13{{ property_prefix("webkit") }} | {{ CompatGeckoDesktop(50) }} | {{ CompatNo }} | {{ CompatNo }} | {{ CompatNo }} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{ CompatNo }} | 0.16{{ property_prefix("webkit") }} | {{ CompatibleGeckoMobile(50) }} | {{ CompatNo }} | {{ CompatNo }} | {{ CompatNo }} |
See also
- File and Directory Entries API
- Introduction to the File System API
- {{domxref("FileSystemEntry")}}, {{domxref("FileSystemFileEntry")}}, and {{domxref("FileSystemDirectoryEntry")}}