nsLocalFile

  • Revision slug: nsLocalFile
  • Revision title: nsLocalFile
  • Revision id: 94629
  • Created:
  • Creator: DarinFisher
  • Is current revision? No
  • Comment /* Remarks */

Revision Content

{{template.Xpcomapi()}}

Summary

A component implementing nsILocalFile.

 ClassID:    2e23e220-60be-11d3-8c4a-000064657374
 ContractID: @mozilla.org/file/local;1

Supported Interfaces

nsILocalFile, nsIFile

Remarks

This component should be accessed via the XPCOM Component Manager.

Example Code

function getFileSize(path) {
  var file =
      Components.classes["@mozilla.org/file/local;1"].
      createInstance(Components.interfaces.nsILocalFile);
  file.initWithPath(path);
  return file.fileSize;
}

Revision Source

<p>
{{template.Xpcomapi()}}
</p>
<h3 name="Summary"> Summary </h3>
<p>A component implementing <code><a href="en/NsILocalFile">nsILocalFile</a></code>.
</p>
<pre class="eval"> ClassID:    2e23e220-60be-11d3-8c4a-000064657374
 ContractID: @mozilla.org/file/local;1
</pre>
<h3 name="Supported_Interfaces"> Supported Interfaces </h3>
<p><code><a href="en/NsILocalFile">nsILocalFile</a></code>,
<code><a href="en/NsIFile">nsIFile</a></code>
</p>
<h3 name="Remarks"> Remarks </h3>
<p>This component should be accessed via the XPCOM Component Manager.
</p>
<h3 name="Example_Code"> Example Code </h3>
<pre>function getFileSize(path) {
  var file =
      Components.classes["@mozilla.org/file/local;1"].
      createInstance(Components.interfaces.nsILocalFile);
  file.initWithPath(path);
  return file.fileSize;
}
</pre>
Revert to this revision