Instance Method

getFileSystemInfo(forPath:isRemovable:isWritable:isUnmountable:description:type:)

Returns information about the file system at the specified path.

Declaration

func getFileSystemInfo(forPath fullPath: String, isRemovable removableFlag: UnsafeMutablePointer<ObjCBool>?, isWritable writableFlag: UnsafeMutablePointer<ObjCBool>?, isUnmountable unmountableFlag: UnsafeMutablePointer<ObjCBool>?, description: AutoreleasingUnsafeMutablePointer<NSString?>?, type fileSystemType: AutoreleasingUnsafeMutablePointer<NSString?>?) -> Bool

Parameters

fullPath

The path to the file system mount point.

removableFlag

On input, a Boolean variable; on return, this variable contains true if the file system is on removable media.

writableFlag

On input, a Boolean variable; on return, this variable contains true if the file system writable.

unmountableFlag

On input, a Boolean variable; on return, this variable contains true if the file system is unmountable.

description

On input, a pointer to a string object variable; on return, if the method was successful, this variable contains a string object that describes the file system. You should not rely on this description for program logic but can use it in message strings. Values can include “hard,” “nfs,” and “foreign."

fileSystemType

On input, a pointer to a string object variable; on return, if the method was successful, this variable contains the file system type. Values can include “HFS,” “UFS,” or other values.

Return Value

true if the information was returned; otherwise, false.

Discussion

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

See Also

Requesting Information

func urlForApplication(toOpen: URL) -> URL?

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

func isFilePackage(atPath: String) -> Bool

Determines whether the specified path is a file package.

var frontmostApplication: NSRunningApplication?

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

var runningApplications: [NSRunningApplication]

Returns an array of running apps.

var menuBarOwningApplication: NSRunningApplication?

Returns the app that owns the currently displayed menu bar.