Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSFileCoordinatorMBS class.

NSFileCoordinatorMBS.NSFileCoordinatorReadingResolvesSymbolicLink = 2

Type Topic Plugin Version
const iCloud MBS MacCloud Plugin 11.2
One of the reading flag constants.

Whether reading of an item that might be a symbolic link file causes the resolution of the link if it is. This affects the URL passed to the block passed to an invocation of one of the coordinateReadingItemAtURL... methods. This is not a valid option to use with prepareForReadingItemsAtURLs.

NSFileCoordinatorMBS.NSFileCoordinatorReadingWithoutChanges = 1

Type Topic Plugin Version
const iCloud MBS MacCloud Plugin 11.2
One of the reading flag constants.

Whether reading does _not_ trigger sending of savePresentedItemChangesWithCompletionHandler to certain NSFilePresenters in the system and waiting for those NSFilePresenters to respond. The default behavior during coordinated reading is to send savePresentedItemChangesWithCompletionHandler to NSFilePresenters.

NSFileCoordinatorMBS.NSFileCoordinatorWritingForDeleting = 1

Type Topic Plugin Version
const iCloud MBS MacCloud Plugin 11.2
One of the writing flag constants.

Whether the writing to be done is actually the deletion of the item. This affects how the writing waits for previously scheduled coordinated reading and writing, how the writing causes subsequently scheduled reading and writing to wait, and what NSFilePresenter messaging is done. See the comments in the Single File Coordination section below. This option is how you trigger sending of accommodatePresentedItemDeletionWithCompletionHandler or accommodatePresentedSubitemDeletionAtURL messages to NSFilePresenters.

For example, Finder uses this when it's emptying the trash to give NSFilePresenters a chance to close documents before their files disappear, or would disappear if the files weren't still open.

NSFileCoordinatorMBS.NSFileCoordinatorWritingForMerging = 4

Type Topic Plugin Version
const iCloud MBS MacCloud Plugin 11.2
One of the writing flag constants.

Whether coordinated writing triggers sending of savePresentedItemChangesWithCompletionHandler to certain NSFilePresenters in the system and waiting for those NSFilePresenters to respond.

NSFileCoordinatorMBS.NSFileCoordinatorWritingForMoving = 2

Type Topic Plugin Version
const iCloud MBS MacCloud Plugin 11.2
One of the writing flag constants.

Whether the writing to be done is actually the moving or renaming of the item. This affects how the writing waits for previously scheduled coordinated reading and writing, how the writing causes subsequently scheduled reading and writing to wait, and what NSFilePresenter messaging is done. See the comments in the Single File Coordination section below. This option has no effect when what's being moved is a plain file so you can use it in code that moves file system items without checking whether the items are files or directories. Any such check would invite a race condition anyway.

For example, Finder uses this when it's moving items that the user has dragged and dropped so as not to yank files contained by moved folders out from underneath applications that are reading or writing those files.

NSFileCoordinatorMBS.NSFileCoordinatorWritingForReplacing = 8

Type Topic Plugin Version
const iCloud MBS MacCloud Plugin 11.2
One of the writing flag constants.

Whether the writing to be done is actually the replacement of the item with a different item. It causes the same behavior as NSFileCoordinatorWritingForDeleting except that when the item being written to is renamed or moved while the writer is being made to wait the item is considered to have been a different item, so the writer is not passed an updated URL to reflect the renaming or moving. Use this when the moving or creation of an item will replace any item that gets in its way. To avoid a race condition use it regardless of whether there is actually an item in the way before the writing begins. Don't use this when simply updating the contents of a file, even if the way you do that is writing the contents to another file and renaming it into place. This is not a valid option to use with prepareForReadingItemsAtURLs.

For example, NSDocument uses this for NSSaveAsOperation and NSSaveToOperation to announce that it is possibly overwriting an item with a brand new file or file package. This gives any NSFilePresenter of the overwritten item, including perhaps a different instance of NSDocument, perhaps in the same application, a chance to close itself before the item is overwritten.

For another example, the most accurate and safe way to coordinate a move is to invoke coordinateWritingItemAtURL using the NSFileCoordinatorWritingForMoving option with the source URL and NSFileCoordinatorWritingForReplacing with the destination URL.

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


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