nsILocalFileMac

by 2 contributors:

Please add a summary to this article.
Inherits from: nsILocalFile Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)

Method overview

CFURLRef getCFURL(); Native code only!
FSRef getFSRef(); Native code only!
FSSpec getFSSpec(); Native code only!
void initToAppWithCreatorCode(in OSType aAppCreator); Native code only! Obsolete since Gecko 2.0
void initWithCFURL(in CFURLRef aCFURL); Native code only!
void initWithFSRef([const] in FSRefPtr aFSRef); Native code only!
void initWithFSSpec([const] in FSSpecPtr aFileSpec); Native code only! Obsolete since Gecko 1.9.2
boolean isPackage();
void launchWithDoc(in nsILocalFile aDocToLoad, in boolean aLaunchInBackground);
void openDocWithApp(in nsILocalFile aAppToOpenWith, in boolean aLaunchInBackground);
void setFileTypeAndCreatorFromExtension(in string aExtension); Obsolete since Gecko 1.9.2
void setFileTypeAndCreatorFromMIMEType(in string aMIMEType); Obsolete since Gecko 1.9.2

Attributes

Attribute Type Description
bundleDisplayName AString Returns the display name of the application bundle (usually the human readable name of the application) Read only.
bundleIdentifier AUTF8String Returns the identifier of the bundle. Read only.
fileCreator OSType Native code only!
fileSizeWithResFork PRInt64 Returns the combined size of both the data fork and the resource fork (if present) rather than just the size of the data fork as returned by GetFileSize() Read only.
fileType OSType File type and creator attributes. Native code only!

Constants

Constant Value Description
CURRENT_PROCESS_CREATOR 0x8000000 Use with SetFileType() to specify the signature of current process. Obsolete since Gecko 2.0

Methods

Native code only!

getCFURL

Note: Observes the state of the followLinks attribute. If the file object is an alias and followLinks is true, returns the target of the alias. If followLinks is false, returns the unresolved alias file.

Note: Supported only for XP_MACOSX.

CFURLRef getCFURL();
Parameters

None.

Return value

The CFURLRef of the file object. The caller is responsible for calling CFRelease() on it.

Native code only!

getFSRef

Note: Observes the state of the followLinks attribute. If the file object is an alias and followLinks is true, returns the target of the alias. If followLinks is false, returns the unresolved alias file.

Note: Supported only for XP_MACOSX.

FSRef getFSRef();
Parameters

None.

Return value

The FSRef of the file object.

Native code only!

getFSSpec

Note: Observes the state of the followLinks attribute. If the file object is an alias and followLinks is true, returns the target of the alias. If followLinks is false, returns the unresolved alias file.

FSSpec getFSSpec();
Parameters

None.

Return value

The FSSpec of the file object.

Native code only!

initToAppWithCreatorCode

Obsolete since Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Init this object to point to an application having the given creator code. If this app is missing, this will fail. It will first look for running application with the given creator.

void initToAppWithCreatorCode(
  in OSType aAppCreator
);
Parameters
aAppCreator
The signature of the app.

Native code only!

initWithCFURL

Init this object with a CFURLRef.

Note: Supported only for XP_MACOSX.

Note: If the path of the CFURL is /a/b/c, at least a/b must exist beforehand.

void initWithCFURL(
  in CFURLRef aCFURL
);
Parameters
aCFURL
The CoreFoundation URL.

Native code only!

initWithFSRef

Init this object with an FSRef.

Note: Supported only for XP_MACOSX.

void initWithFSRef(
  [const] in FSRefPtr aFSRef
);
Parameters
aFSRef
The native FSRef.

Native code only!

initWithFSSpec

Obsolete since Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Init this object with an FSSpec Legacy method - leaving in place for now.

void initWithFSSpec(
  [const] in FSSpecPtr aFileSpec
);
Parameters
aFileSpec
The native file spec.

isPackage()

boolean isPackage();
Parameters

None.

Return value

true if a directory is determined to be a package under Mac OS 9/X.

launchWithDoc()

Launch the application that this file points to with a document.

void launchWithDoc(
  in nsILocalFile aDocToLoad,
  in boolean aLaunchInBackground
);
Parameters
aDocToLoad
Must not be null. If no document, use nsILocalFile::launch.
aLaunchInBackground
true if the application should not come to the front.

openDocWithApp()

Open the document that this file points to with the given application.

void openDocWithApp(
  in nsILocalFile aAppToOpenWith,
  in boolean aLaunchInBackground
);
Parameters
aAppToOpenWith
The application with which to open the document. If null, the creator code of the document is used to determine the application.
aLaunchInBackground
true if the application should not come to the front.

Obsolete since Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

setFileTypeAndCreatorFromExtension()

Sets the file type and creator code from a file extension Internet Config is used to determine the mapping.

void setFileTypeAndCreatorFromExtension(
  in string aExtension
);
Parameters
aExtension

Obsolete since Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

setFileTypeAndCreatorFromMIMEType()

Sets the file type and creator code from a MIME type. Internet Config is used to determine the mapping.

void setFileTypeAndCreatorFromMIMEType(
  in string aMIMEType
);
Parameters
aMIMEType

Document Tags and Contributors

Contributors to this page: Sheppy, trevorh
Last updated by: Sheppy,