Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

nsLocalFile

« XPCOM API Reference

Summary

A component implementing nsILocalFile.

Class ID
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;
}

See also

Components, nsIComponentManager

Document Tags and Contributors

 Contributors to this page: fscholz, TechieEddie, Smi, DarinFisher
 Last updated by: fscholz,