Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSFileWrapperMBS class.
NSFileWrapperMBS.initDirectoryWithFileWrappers(childrenByPreferredName as Dictionary) as NSFileWrapperMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Text | MBS MacBase Plugin | 16.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
childrenByPreferredName: Key-value dictionary of file wrappers with which to initialize the receiver. The dictionary must contain entries whose values are the file wrappers that are to become children and whose keys are filenames. See Working with Directory Wrappers in File System Programming Guide for more information about the file-wrapper list structure.
Returns initialized file wrapper for fileWrappers.
After initialization, the file wrapper is not associated with a file-system node until you save it using writeToURL:options:originalContentsURL:.
The receiver is initialized with open permissions: anyone can read, write, or modify the directory on disk.
If any file wrapper in the directory doesn’t have a preferred filename, its preferred name is automatically set to its corresponding key in the childrenByPreferredName dictionary.
NSFileWrapperMBS.initRegularFileWithContents(data as MemoryBlock) as NSFileWrapperMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Text | MBS MacBase Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
After initialization, the file wrapper is not associated with a file-system node until you save it using writeToURL.
The file wrapper is initialized with open permissions: anyone can write to or read the file wrapper.
NSFileWrapperMBS.initWithFile(File as folderItem, Options as Integer, byref error as NSErrorMBS) as NSFileWrapperMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Text | MBS MacBase Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
File: FolderItem of the file-system node the file wrapper is to represent.
options: Option flags for reading the node located at folderitem. Can be NSFileWrapperReadingImmediate and/or NSFileWrapperReadingWithoutMapping.
Error: If an error occurs, upon return contains an NSErrorMBS object that describes the problem.
Returns File wrapper for the file-system node at folderitem. May be a directory, file, or symbolic link, depending on what is located at the folderitem. Returns nil if reading is not successful.
If folderitem is a directory, this method recursively creates file wrappers for each node within that directory. Use the fileWrappers property to get the file wrappers of the nodes contained by the directory.
Available in OS X v10.6 and later.
NSFileWrapperMBS.initWithSerializedRepresentation(data as MemoryBlock) as NSFileWrapperMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Text | MBS MacBase Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
serializedRepresentation: Serialized representation of a file wrapper in the format used for the NSFileContentsPboardType pasteboard type. Data of this format is returned by such methods as serializedRepresentation and RTFDFromRange (in NSAttributedString).
Returns regular-file file wrapper initialized from serializedRepresentation.
The file wrapper is not associated with a file-system node until you save it using writeToURL.
NSFileWrapperMBS.initWithURL(URL as string, Options as Integer, byref error as NSErrorMBS) as NSFileWrapperMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
shared method | Cocoa Text | MBS MacBase Plugin | 15.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
url: URL of the file-system node the file wrapper is to represent.
options: Option flags for reading the node located at url. Can be NSFileWrapperReadingImmediate and/or NSFileWrapperReadingWithoutMapping.
Error: If an error occurs, upon return contains an NSErrorMBS object that describes the problem.
Returns File wrapper for the file-system node at url. May be a directory, file, or symbolic link, depending on what is located at the URL. Returns nil if reading is not successful.
If url is a directory, this method recursively creates file wrappers for each node within that directory. Use the fileWrappers property to get the file wrappers of the nodes contained by the directory.
Available in OS X v10.6 and later.
The items on this page are in the following plugins: MBS MacBase Plugin.