A method identified as deprecated has been superseded and may become unsupported in the future.
Creates a file wrapper from a given file-system node and adds it to the receiver, which must be a directory file wrapper. (Deprecated in Mac OS X v10.6. Use addFileWrapper: instead.)
- (NSString *)addFileWithPath:(NSString *)node
file-system node from which to create the file wrapper to add to the directory.
Dictionary key used to store the new file wrapper in the directory’s list of file wrappers. See Working With Directory Wrappers for more information.
Beginning with Mac OS X v10.6, the preferred method of referring to files is with a file:// URL. Instead of using this method, you can instantiate NSFileWrapper with one of the initializers, send it setPreferredFilename: if necessary, and pass the result to addFileWrapper:.
This method raises NSInternalInconsistencyException if the receiver is not a directory file wrapper.
– addRegularFileWithContents:preferredFilename:– addSymbolicLinkWithDestination:preferredFilename:– removeFileWrapper:– fileWrappersNSFileWrapper.hCreates a symbolic-link file wrapper pointing to a given file-system node and adds it to the receiver, which must be a directory file wrapper. (Deprecated in Mac OS X v10.6. Use addFileWrapper: instead.)
- (NSString *)addSymbolicLinkWithDestination:(NSString *)node preferredFilename:(NSString *)preferredFilename
Pathname the new symbolic-link file wrapper is to reference.
Preferred filename for the new symbolic-link file wrapper.
Dictionary key used to store the new file wrapper in the directory’s list of file wrappers. See Working With Directory Wrappers for more information.
Beginning with Mac OS X v10.6, the preferred method of referring to files is with a file:// URL. Instead of using this method, you can instantiate NSFileWrapper with one of the initializers, send it setPreferredFilename: if necessary, and pass the result to addFileWrapper:.
This method raises NSInternalInconsistencyException if the receiver is not a directory file wrapper.
This method raises NSInvalidArgumentException if you pass nil or an empty value for preferredFilename.
– addFileWrapper:– addRegularFileWithContents:preferredFilename:– removeFileWrapper:– fileWrappersNSFileWrapper.hInitializes the receiver as a symbolic-link file wrapper. (Deprecated in Mac OS X v10.6. Use initSymbolicLinkWithDestinationURL: instead.)
- (id)initSymbolicLinkWithDestination:(NSString *)node
Pathname the receiver is to represent.
Initialized symbolic-link file wrapper referencing node.
The receiver is not associated to a file-system node until you save it using writeToFile:atomically:updateFilenames:. It’s also initialized with open permissions; anyone can read or write the disk representations it saves.
Beginning with Mac OS X v10.6, the preferred method of referring to files is with a file:// URL. Therefore, this method has been deprecated in favor of initSymbolicLinkWithDestinationURL:.
NSFileWrapper.hInitializes a file wrapper instance whose kind is determined by the type of file-system node located by the path. (Deprecated in Mac OS X v10.6. Use initWithURL:options:error: instead.)
- (id)initWithPath:(NSString *)node
Pathname of the file-system node the file wrapper is to represent.
File wrapper for node.
If node is a directory, this method recursively creates file wrappers for each node within that directory.
Beginning with Mac OS X v10.6, the preferred method of referring to files is with a file:// URL. Therefore, this method has been deprecated in favor of initWithURL:options:error:.
NSFileWrapper.hIndicates whether the file wrapper needs to be updated to match a given file-system node. (Deprecated in Mac OS X v10.6. Use matchesContentsOfURL: instead.)
- (BOOL)needsToBeUpdatedFromPath:(NSString *)node
file-system node with which to compare the file wrapper.
This table describes which attributes of the file wrapper and node are compared to determine whether the file wrapper needs to be updated:
File-wrapper type | Comparison determinants |
|---|---|
Regular file | Modification date and access permissions. |
Directory | Member hierarchy (recursive). |
Symbolic link | Destination pathname. |
Beginning with Mac OS X v10.6, the preferred method of referring to files is with a file:// URL. Therefore, this method has been deprecated in favor of matchesContentsOfURL:.
NSFileWrapper.hProvides the pathname referenced by the receiver, which must be a symbolic-link file wrapper. (Deprecated in Mac OS X v10.6. Use symbolicLinkDestinationURL instead.)
- (NSString *)symbolicLinkDestination
Pathname the file wrapper references (the destination of the symbolic link the file wrapper represents).
Beginning with Mac OS X v10.6, the preferred method of referring to files is with a file:// URL. Therefore, this method has been deprecated in favor of symbolicLinkDestinationURL.
This method raises NSInternalInconsistencyException if the receiver is not a symbolic-link file wrapper.
NSFileWrapper.hUpdates the file wrapper to match a given file-system node. (Deprecated in Mac OS X v10.6. Use readFromURL:options:error: instead.)
- (BOOL)updateFromPath:(NSString *)path
For a directory file wrapper, the contained file wrappers are also sent updateFromPath: messages. If nodes in the corresponding directory on the file system have been added or removed, corresponding file wrappers are released or created as needed.
Beginning with Mac OS X v10.6, the preferred method of referring to files is with a file:// URL. Therefore, this method has been deprecated in favor of readFromURL:options:error:.
– needsToBeUpdatedFromPath:– updateAttachmentsFromPath: (NSAttributedString)NSFileWrapper.hWrites a file wrapper’s contents to a given file-system node. (Deprecated in Mac OS X v10.6. Use writeToURL:options:originalContentsURL:error: instead.)
- (BOOL)writeToFile:(NSString *)node atomically:(BOOL)atomically updateFilenames:(BOOL)updateNames
Pathname of the file-system node to which the receiver’s contents are written.
YES to write the file safely so that:
An existing file is not overwritten
The method fails if the file cannot be written in its entirety
NO to overwrite an existing file and ignore incomplete writes.
YES to update the receiver’s filenames (its filename and—for directory file wrappers—the filenames of its sub–file wrappers) be changed to the filenames of the corresponding nodes in the file system, after a successful write operation. Use this in Save or Save As operations.
NO to specify that the receiver’s filenames not be updated. Use this in Save To operations.
Beginning with Mac OS X v10.6, the preferred method of referring to files is with a file:// URL. Therefore, this method has been deprecated in favor of writeToURL:options:originalContentsURL:error:.
NSFileWrapper.h© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-05-26)