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
getCFURL
true
, returns the target of the alias. If followLinks is false
, returns the unresolved alias file.CFURLRef getCFURL();
Parameters
None.
Return value
The CFURLRef of the file object. The caller is responsible for calling CFRelease() on it.
getFSRef
true
, returns the target of the alias. If followLinks is false
, returns the unresolved alias file.FSRef getFSRef();
Parameters
None.
Return value
The FSRef of the file object.
getFSSpec
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.
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.
initWithCFURL
Init this object with a CFURLRef.
void initWithCFURL( in CFURLRef aCFURL );
Parameters
aCFURL
- The CoreFoundation URL.
initWithFSRef
Init this object with an FSRef.
void initWithFSRef( [const] in FSRefPtr aFSRef );
Parameters
aFSRef
- The native FSRef.
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, usensILocalFile
::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.
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
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