Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

Next items

NSFileManagerMBS.fileManagerWithAuthorization(authorization as NSWorkspaceAuthorizationMBS) as NSFileManagerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 19.3 Yes No No Yes, macOS only No
Function: Initializes a file manager object that is authorized to perform privileged file system operations.
Notes:
Returns nil in case of errors.

This method returns an NSFileManagerMBS instance that can perform file system operations previously allowed by the user via NSWorkspaceMBS.requestAuthorization. Each NSWorkspaceAuthorizationMBS you receive requires creating a new NSFileManagerMBS instance using this method.

Only the following NSFileManagerMBS methods currently take advantage of an authorization:

  • createSymbolicLink (NSWorkspaceAuthorizationTypeCreateSymbolicLink)
  • setAttributes (NSWorkspaceAuthorizationTypeSetAttributes)
  • replaceItem (NSWorkspaceAuthorizationTypeReplaceFile)

Note that an NSWorkspaceAuthorizationTypeSetAttributes authorization only enables setAttributes to modify the following attributes:

  • NSFileOwnerAccountID
  • NSFileGroupOwnerAccountID
  • NSFilePosixPermissions

Also note that for replaceItem, the backupItemName and options parameters will be ignored.

These methods may also fail with any of the following errors:
  • NSWorkspaceAuthorizationInvalidError: The provided NSWorkspaceAuthorization expired or is invalid.
  • NSFileWriteUnknownError: The application failed to communicate with a helper process, or a file system error occurred.
  • NSFileWriteNoPermissionError: The operation failed for any other reason, including the user denying access to the resource, or access to a resource is denied by system policy.

All other NSFileManager methods invoked on this instance will behave normally.

Feedback, Comments & Corrections

NSFileManagerMBS.lastPathComponent(pathOrURL as string) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Returns the last path component of a file URL or file path.
Notes: Available in Mac OS X v10.6 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileAppendOnly as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates whether the file is read-only.
The corresponding value is a number containing a Boolean value.
Available in Mac OS X v10.2 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileBusy as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates whether the file is busy.
The corresponding value is a number containing a Boolean value.
Available in Mac OS X v10.4 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileCreationDate as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's creation date.
The corresponding value is a date.
Available in Mac OS X v10.2 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileDeviceIdentifier as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the identifier for the device on which the file resides.
The corresponding value is a number containing an Int32.
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileExtensionHidden as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates whether the file's extension is hidden.
The corresponding value is a number containing a Boolean value.
Available in Mac OS X v10.1 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileGroupOwnerAccountID as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's group ID.
The corresponding value is a number containing an Int32.
Available in Mac OS X v10.2 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileGroupOwnerAccountName as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the group name of the file's owner.
The corresponding value is a string.
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileHFSCreatorCode as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's HFS creator code.
The corresponding value is a number containing an Int32. See "HFS File Types" for possible values.
Available in Mac OS X v10.1 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileHFSTypeCode as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's HFS type code.
The corresponding value is a number containing an Int32. See "HFS File Types" for possible values.
Available in Mac OS X v10.1 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileImmutable as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Example:
Dim n As New NSFileManagerMBS
dim e as NSErrorMBS
Dim d As Dictionary = n.attributesOfItemAtPath("/Users/cs/Desktop/test.rtf", e)
dim locked as Boolean = d.Lookup(n.NSFileImmutable, false)

Break // inspect in debugger
Notes:
The key in a file attribute dictionary whose value indicates whether the file is mutable.
The corresponding value is a number containing a Boolean value.
Available in Mac OS X v10.2 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileManagerUnmountDissentingProcessIdentifierErrorKey as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 18.5 Yes No No Yes, macOS only No
Function: The key for the error dictionary containing process ID of the process blocking the unmount.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileModificationDate as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's last modified date.
The corresponding value is a date.
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileOwnerAccountID as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's owner's account ID.
The corresponding value is a number containing an Int32.
Available in Mac OS X v10.2 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileOwnerAccountName as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the name of the file's owner.
The corresponding value is a string.
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFilePosixPermissions as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's Posix permissions.
The corresponding value is a number.
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileReferenceCount as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's reference count.
The corresponding value is a number containing an Int32.
The number specifies the number of hard links to a file.
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileSize as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's size in bytes.
The corresponding value is a number containing an Int64.
Important If the file has a resource fork, the returned value does not include the size of the resource fork.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileSystemFileNumber as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's filesystem file number.
The corresponding value is a number containing an Int32. The value corresponds to the value of st_ino, as returned by stat(2).
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileSystemFreeNodes as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access the file attribute values contained in the dictionary object returned from the attributesOfFileSystemForPath function.
Notes:
The key in a file system attribute dictionary dictionary whose value indicates the number of free nodes in the file system.
The corresponding value is a number that specifies the number of free nodes in the file system.
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileSystemFreeSize as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access the file attribute values contained in the dictionary object returned from the attributesOfFileSystemForPath function.
Notes:
The key in a file system attribute dictionary whose value indicates the amount of free space on the file system.
The corresponding value is a number that specifies the amount of free space on the file system in bytes. The value is determined by statfs().
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileSystemNodes as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access the file attribute values contained in the dictionary object returned from the attributesOfFileSystemForPath function.
Notes:
The key in a file system attribute dictionary whose value indicates the number of nodes in the file system.
The corresponding value is a number that specifies the number of nodes in the file system.
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileSystemNumber as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access the file attribute values contained in the dictionary object returned from the attributesOfFileSystemForPath function.
Notes:
The key in a file system attribute dictionary dictionary whose value indicates the filesystem number of the file system.
The corresponding value is a number that specifies the filesystem number of the file system. The value corresponds to the value of st_dev, as returned by stat(2).
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileSystemSize as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access the file attribute values contained in the dictionary object returned from the attributesOfFileSystemForPath function.
Notes:
The key in a file system attribute dictionary whose value indicates the size of the file system.
The corresponding value is a number that specifies the size of the file system in bytes. The value is determined by statfs().
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileType as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the keys to access file attribute values contained in dictionary used by setAttributes, attributesOfItemAtPath, createDirectory, and createFile.
Notes:
The key in a file attribute dictionary whose value indicates the file's type.
The corresponding value is a string (see NSFileType* shared methods for possible values).
Available in Mac OS X v10.0 and later.

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileTypeBlockSpecial as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the possible NSFileType values.
Example:
// check first hard disc
dim e as NSErrorMBS
dim n as new NSFileManagerMBS
dim d as Dictionary = n.attributesOfItemAtPath("/dev/disk0", e)
MsgBox d.Value(n.NSFileType)
Notes: Block special file (e.g. hard disk)

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileTypeCharacterSpecial as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the possible NSFileType values.
Notes: Character special file

Feedback, Comments & Corrections

NSFileManagerMBS.NSFileTypeDirectory as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method iCloud MBS MacCocoa Plugin 12.3 Yes No No Yes, macOS only No
Function: One of the possible NSFileType values.
Example:
dim e as NSErrorMBS
dim n as new NSFileManagerMBS
dim d as Dictionary = n.attributesOfItemAtPath("/System", e)
MsgBox d.Value(n.NSFileType)
Notes: Directory

Feedback, Comments & Corrections

Next items

The items on this page are in the following plugins: MBS MacCocoa Plugin.




Links
MBS Xojo Chart Plugins