XPCOMUtils.jsm

  • Revision slug: JavaScript_code_modules/XPCOMUtils.jsm
  • Revision title: XPCOMUtils.jsm
  • Revision id: 45631
  • Created:
  • Creator: philikon
  • Is current revision? No
  • Comment 127 words added, 1355 words removed

Revision Content

{{ gecko_minversion_header("1.9.2") }}

The FileUtils.jsm JavaScript code module offers utility routines dealing with files. To use it, you first need to import the code module into your JavaScript scope:

Components.utils.import("resource://gre/modules/FileUtils.jsm");

Method overview

nsIFile getFile(key, pathArray, followLinks); nsIFile getDir(key, pathArray, shouldCreate, followLinks);

Constants

Constant Value Description
MODE_RDONLY 0x01 XXX

Methods

init()

void init(
  in nsIFile file,
  in long ioFlags,
  in long perm,
  in long behaviorFlags
);
Parameters
file
File to read from (must QI to {{ interface("nsILocalFile") }})
ioFlags
The file status flags define how the file is accessed. See PR_Open documentation for more details. If set to -1 the file will be opened in default mode (PR_RDONLY).
perm
File mode bits are described in the PR_Open documentation. If set to -1 the default value 0 will be used.
behaviorFlags
Flags specifying various behaviors of the class (see enumerations in the class).

See also

  • {{ interface("nsIFileOutputStream") }}
https://developer.mozilla.org/en/PR_Open#Parameters

Revision Source

<p>{{ gecko_minversion_header("1.9.2") }}</p>
<p>The <code>FileUtils.jsm</code> JavaScript code module offers utility routines dealing with files. To use it, you first need to import the code module into your JavaScript scope:</p>
<pre>Components.utils.import("resource://gre/modules/FileUtils.jsm");
</pre>
<h2 name="Method_overview">Method overview</h2>
<table class="standard-table"> <tbody> <tr> <td><code>nsIFile <a href="#getFile()">getFile</a>(key, pathArray, followLinks);</code></td> <td><code>nsIFile <a href="#getDir()">getDir</a>(key, pathArray, shouldCreate, followLinks);</code></td> </tr> </tbody>
</table>
<h2 name="Constants">Constants</h2>
<table class="standard-table"> <tbody> <tr> <td class="header">Constant</td> <td class="header">Value</td> <td class="header">Description</td> </tr> <tr> <td><code>MODE_RDONLY</code></td> <td><code>0x01</code></td> <td>XXX</td> </tr> </tbody>
</table>
<h2 name="Methods">Methods</h2>
<h3 name="init()">init()</h3>
<pre class="eval">void init(
  in nsIFile file,
  in long ioFlags,
  in long perm,
  in long behaviorFlags
);
</pre>
<h6 name="Parameters">Parameters</h6>
<dl> <dt><code>file</code></dt> <dd>File to read from (must QI to {{ interface("nsILocalFile") }})</dd> <dt><code>ioFlags</code></dt> <dd>The file status flags define how the file is accessed. See <a href="/en/PR_Open#Parameters" title="en/PR_Open#Parameters">PR_Open documentation</a> for more details. If set to -1 the file will be opened in default mode (<code>PR_RDONLY</code>).</dd> <dt><code>perm</code></dt> <dd>File mode bits are described in the <a href="/en/PR_Open#Parameters" title="en/PR_Open#Parameters">PR_Open documentation</a>. If set to -1 the default value 0 will be used.</dd> <dt><code>behaviorFlags</code></dt> <dd>Flags specifying various behaviors of the class (see enumerations in the class).</dd>
</dl>
<h2 name="See_also">See also</h2>
<ul> <li>{{ interface("nsIFileOutputStream") }}</li>
</ul> https://developer.mozilla.org/en/PR_Open#Parameters
Revert to this revision