nsLocalFile

  • Revision slug: nsLocalFile
  • Revision title: nsLocalFile
  • Revision id: 94633
  • Created:
  • Creator: TechieEddie
  • Is current revision? No
  • Comment one or more formatting changes; page display name reset to default

Revision Content

{{ Xpcomapi() }}

Summary

A component implementing nsILocalFile.

{{ ComponentSummary("2e23e220-60be-11d3-8c4a-000064657374", "@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;
}

See also

Components, {{ Interface("nsIComponentManager") }}

Revision Source

<p>{{ Xpcomapi() }}</p>
<h3 name="Summary">Summary</h3>
<p>A component implementing <code><a href="/en/nsILocalFile" title="en/nsILocalFile">nsILocalFile</a></code>.</p>
<p>{{ ComponentSummary("2e23e220-60be-11d3-8c4a-000064657374", "@mozilla.org/file/local;1") }}</p>
<h3 name="Supported_Interfaces">Supported Interfaces</h3>
<p><code><a href="/en/XPCOM_Interface_Reference/nsILocalFile" title="en/XPCOM Interface Reference/nsILocalFile">nsILocalFile</a></code>, <code><a href="/en/XPCOM_Interface_Reference/nsIFile" title="en/nsIFile">nsIFile</a></code></p>
<h3 name="Remarks">Remarks</h3>
<p>This component should be accessed via the <a class="internal" href="/en/XPCOM_Interface_Reference/nsIComponentManager" title="En/NsIComponentManager">XPCOM Component Manager</a>.</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>
<h3>See also</h3>
<p><a class="internal" href="/en/Components_object" title="En/Components object">Components</a>, {{ Interface("nsIComponentManager") }}</p>
Revert to this revision