Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 1119329 of FileSystem

  • Revision slug: Web/API/FileSystem
  • Revision title: FileSystem
  • Revision id: 1119329
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment

Revision Content

{{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") }} {{ CompatGeckoMobile(50) }} {{ CompatNo }} {{ CompatNo }} {{ CompatNo }}

See also

Revision Source

<p>{{APIRef("File System API")}} {{non-standard_header}}</p>

<p>The File and Directory Entries API interface <strong><code>FileSystem</code></strong> is used to represent a file system. Each object is passed to the success callback when <a href="/en/DOM/File_API/File_System_API/LocalFileSystem#requestFileSystem()" title="https://developer.mozilla.org/en/DOM/File_API/File_System_API/LocalFileSystem#requestFileSystem()"><code>requestFileSystem()</code></a> is called.</p>

<div class="note">
<p>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.</p>
</div>

<h2 id="Basic_concepts">Basic concepts</h2>

<p>There are two ways to get access to a <code>FileSystem</code> object: you can directly ask for one representing a sandboxed file system created just for your web app directly by calling <code>window.requestFileSystem()</code>.&nbsp; If that call is successful, it executes a callback handler, which receives as a parameter a <code>FileSystem</code> object describing the file system.</p>

<p>The <code>FileSystem</code> 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).</p>

<h2 id="Properties">Properties</h2>

<dl>
 <dt>{{domxref("FileSystem.name")}} {{ReadOnlyInline}}</dt>
 <dd>A {{domxref("DOMString")}} representing the file system's name. This name is unique among the entire list of exposed file systems.</dd>
 <dt>{{domxref("FileSystem.root")}} {{ReadOnlyInline}}</dt>
 <dd>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.</dd>
</dl>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('File System API')}}</td>
   <td>{{Spec2('File System API')}}</td>
   <td>Draft of proposed API</td>
  </tr>
 </tbody>
</table>

<p>This API has no official W3C or WHATWG specification.</p>

<h2 id="Browser_compatibility" name="Browser_compatibility">Browser compatibility</h2>

<p>{{ CompatibilityTable }}</p>

<div id="compat-desktop">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Chrome</th>
   <th>Firefox (Gecko)</th>
   <th>Internet Explorer</th>
   <th>Opera</th>
   <th>Safari (WebKit)</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>13{{ property_prefix("webkit") }}</td>
   <td>{{ CompatGeckoDesktop(50) }}</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatNo }}</td>
  </tr>
 </tbody>
</table>
</div>

<div id="compat-mobile">
<table class="compat-table">
 <tbody>
  <tr>
   <th>Feature</th>
   <th>Android</th>
   <th>Chrome for Android</th>
   <th>Firefox Mobile (Gecko)</th>
   <th>IE&nbsp;Phone</th>
   <th>Opera Mobile</th>
   <th>Safari Mobile</th>
  </tr>
  <tr>
   <td>Basic support</td>
   <td>{{ CompatNo }}</td>
   <td>0.16{{ property_prefix("webkit") }}</td>
   <td>{{ CompatGeckoMobile(50) }}</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatNo }}</td>
   <td>{{ CompatNo }}</td>
  </tr>
 </tbody>
</table>
</div>

<h2 id="See_also">See also</h2>

<ul>
 <li><a href="/en-US/docs/Web/API/File_and_Directory_Entries_API">File and Directory Entries API</a></li>
 <li><a href="/en-US/docs/Web/API/File_and_Directory_Entries_API/Introduction">Introduction to the File System API</a></li>
 <li>{{domxref("FileSystemEntry")}}, {{domxref("FileSystemFileEntry")}}, and {{domxref("FileSystemDirectoryEntry")}}</li>
</ul>
Revert to this revision