nsILocalFileMac

IID:614c3010-1dd2-11b2-be04-bcd57a64ffc9
Inherits From:nsILocalFile

Constants

Use with SetFileType() to specify the signature of current process
PRUint32 CURRENT_PROCESS_CREATOR = 134217728

Properties

OSType fileCreator

readonly PRInt64 fileSizeWithResFork

FileSizeWithResFork

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()

OSType fileType

FileType, creator

File type and creator attributes


Methods

CFURLRef getCFURL ( ) FSRef getFSRef ( ) FSSpec getFSSpec ( ) void initToAppWithCreatorCode ( OSType appCreator ) void initWithCFURL ( CFURLRef CFURL ) void initWithFSRef ( FSRefPtr* FSRef ) void initWithFSSpec ( FSSpecPtr* fileSpec ) PRBool isPackage ( ) void launchWithDoc ( nsILocalFile docToLoad , PRBool launchInBackground ) void openDocWithApp ( nsILocalFile appToOpenWith , PRBool launchInBackground ) void setFileTypeAndCreatorFromExtension ( char* extension ) void setFileTypeAndCreatorFromMIMEType ( char* MIMEType )

CFURLRef getCFURL ( )

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

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 or TARGET_CARBON


FSRef getFSRef ( )

Returns the FSRef of the file object.

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 or TARGET_CARBON


FSSpec getFSSpec ( )

Returns the FSSpec of the file object.

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.


void initToAppWithCreatorCode ( OSType appCreator )

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.

Arguments:
appCreator: the signature of the app

void initWithCFURL ( CFURLRef CFURL )

Init this object with a CFURLRef

NOTE: Supported only for XP_MACOSX or TARGET_CARBON NOTE: If the path of the CFURL is /a/b/c, at least a/b must exist beforehand.

Arguments:
CFURL: the CoreFoundation URL

void initWithFSRef ( FSRefPtr* FSRef )

Init this object with an FSRef

NOTE: Supported only for XP_MACOSX or TARGET_CARBON

Arguments:
FSRef: the native file spec

void initWithFSSpec ( FSSpecPtr* fileSpec )

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

Arguments:
fileSpec: the native file spec

PRBool isPackage ( )

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


void launchWithDoc ( nsILocalFile docToLoad , PRBool launchInBackground )

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

Arguments:
docToLoad: Must not be NULL. If no document, use nsILocalFile::launch
launchInBackground: TRUE if the application should not come to the front.

void openDocWithApp ( nsILocalFile appToOpenWith , PRBool launchInBackground )

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

Arguments:
appToOpenWith: The application with which to open the document. If NULL, the creator code of the document is used to determine the application.
launchInBackground: TRUE if the application should not come to the front.

void setFileTypeAndCreatorFromExtension ( char* extension )

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

Arguments:
extension

void setFileTypeAndCreatorFromMIMEType ( char* MIMEType )

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

Arguments:
MIMEType

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com