Instance Method

getInfoForFile:application:type:

Retrieves information about the specified file.

Declaration

- (BOOL)getInfoForFile:(NSString *)fullPath application:(NSString * _Nullable *)appName type:(NSString * _Nullable *)type;

Parameters

fullPath

The full path to the desired file.

appName

The app the system would use to open the file.

type

On input, a pointer to a string object variable; on return, if the method is successful, this variable contains a string object with the filename extension or encoded HFS file type of the file.

Return Value

YES if this method successfully retrieved the information, or NO if it couldn't find the file or the app isn't associated with the file.

Discussion

You can safely call this method from any thread of your app.

See Also

Requesting Information

- URLForApplicationToOpenURL:

Returns the URL to the default app that would be opened.

- getFileSystemInfoForPath:isRemovable:isWritable:isUnmountable:description:type:

Returns information about the file system at the specified path.

- isFilePackageAtPath:

Determines whether the specified path is a file package.

frontmostApplication

Returns the frontmost app, which is the app that receives key events.

runningApplications

Returns an array of running apps.

menuBarOwningApplication

Returns the app that owns the currently displayed menu bar.