Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSFileVersionMBS class.
NSFileVersionMBS.addVersionOfItemAtURL(url as string, withContentsOfURL as string, options as Integer, byref error as NSErrorMBS) as NSFileVersionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
If not successful, return false after setting Error to an NSErrorMBS that encapsulates why not.
You can add versions only on Mac OS X.
When adding or removing versions of a file you should do it as part of a "coordinated" write to the file. see NSFileCoordinatorMBS class. Using it properly ensures that NSFilePresenters of the file, or directories that contain the file, receive accurate notifications about versions being added or removed. For example, use NSFileCoordinatorMBS.coordinateWritingItemAtURL when the file URL and the contents url are the same. (NSFileVersion doesn't simply use NSFileCoordinator itself because that would be insufficient when the adding or removing of versions is part of a larger operation that should be treated as one coordinated file access.)
NSFileVersionMBS.currentVersionOfItemAtURL(file as folderitem) as NSFileVersionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
NSFileVersionMBS.currentVersionOfItemAtURL(url as string) as NSFileVersionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
NSFileVersionMBS.FileURL(file as folderitem) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Call is method in case you need to provide an URL for a folderitem.
NSFileVersionMBS.otherVersionsOfItemAtURL(file as folderitem) as NSFileVersionMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
NSFileVersionMBS.otherVersionsOfItemAtURL(url as string) as NSFileVersionMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The array never contains an NSFileVersionMBS equal to what currentVersionOfItemAtURL would return.
See also:
NSFileVersionMBS.removeOtherVersionsOfItemAtURL(file as folderitem, byref error as NSErrorMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
NSFileVersionMBS.removeOtherVersionsOfItemAtURL(url as string, byref error as NSErrorMBS) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
If not successful, return false after setting error to an NSErrorMBS that encapsulates why not.
When removing versions of a file you should do it as part of a coordinated write to the file. The advice about this for addVersionOfItemAtURL applies here too.
See also:
NSFileVersionMBS.temporaryDirectoryURLForNewVersionOfItemAtURL(url as string) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
This is useful when you want to create a new version of a file out of something other than the file's current contents, for example, the contents in memory of a document that has not yet been saved to its file. You must remove this directory when you are done with it, using NSFileManagerMBS.removeItemAtURL for example.
NSFileVersionMBS.unresolvedConflictVersionsOfItemAtURL(file as folderitem) as NSFileVersionMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
NSFileVersionMBS.unresolvedConflictVersionsOfItemAtURL(url as string) as NSFileVersionMBS()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See also:
NSFileVersionMBS.versionOfItemAtURLforPersistentIdentifier(file as folderitem, PersistentIdentifier as Memoryblock) as NSFileVersionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
url: The URL of the file whose version you want.
persistentIdentifier: The persistent ID of the NSFileVersion object you want. The plugin decodes it for you from the memoryblock.
Returns the file version object with the specified ID or nil if no such version object exists.
See also:
NSFileVersionMBS.versionOfItemAtURLforPersistentIdentifier(URL as string, PersistentIdentifier as Memoryblock) as NSFileVersionMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | iCloud | MBS MacCloud Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
url: The URL of the file whose version you want.
persistentIdentifier: The persistent ID of the NSFileVersion object you want. The plugin decodes it for you from the memoryblock.
Returns the file version object with the specified ID or nil if no such version object exists.
See also:
The items on this page are in the following plugins: MBS MacCloud Plugin.