Platforms to show: All Mac Windows Linux Cross-Platform

NSFileManagerMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class iCloud MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ✅ Yes All
The NSFileManager class enables you to perform many generic file-system operations and insulates an application from the underlying file system.

In Xojo you can do the same with folderitem. But for some iCloud related tasks you need to use this class.

In Cocoa applications, a file manager object is usually your first interaction with the file system. You use this object to locate, create, copy, and move files and directories. You also use this object to get information about files and directories, such as its size, modification date, and BSD permissions. You can also use a file manager object to change the values of many file and directory attributes.

The NSFileManagerMBS class supports both the folderitem and path string as ways to specify the location of a file or directory. The use of the folderitem is generally preferred for specifying file-system items because they can convert path information to a more efficient representation internally. You can also obtain a bookmark from an folderitem, which is similar to an alias and offers a more sure way of locating the file or directory later.

In iOS 5.0 and later and in Mac OS X v10.7 and later, NSFileManager includes methods for managing items stored in the cloud. Files and directories tagged for cloud storage are synced to the user's MobileMe account so that they can be made available to the user's iOS devices and Macintosh computers. Changes to an item in one location are propagated to all other locations to ensure the items stay in sync.

Unmount options

Constant Value Description
NSFileManagerUnmountAllPartitionsAndEjectDisk 1 Unmount all partitions of this disk and eject it.
NSFileManagerUnmountWithoutUI 2 Unmount without user interface.


Constant Value Description
NSURLRelationshipContains 0 The directory contains the specified item.
NSURLRelationshipOther 2 The directory does not contain the item and is not the same as the item.
NSURLRelationshipSame 1 The directory and the item are the same. This relationship occurs when the value of the
NSURLFileResourceIdentifierKey is the same for the directory and item.

This class has no sub classes.

Some properties using for this class:

Some examples using this class:

Blog Entries

Xojo Developer Magazine

Release notes

  • Version 19.5
    • Added path variants for copyItem, copyItemMT, linkItem, moveItem, trashItem in NSFileManagerMBS class.
  • Version 19.3
  • Version 18.5
    • Added more methods for NSFileManagerMBS.
    • Changed methods in NSFileManagerMBS to be regular ones, not shared. This is needed as we may have multiple file managers.
  • Version 18.2

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

NSFileHandleMBS   -   NSFilePresenterHandlerMBS

💬 Ask a question or report a problem
The biggest plugin in space...