Deprecated NSFileWrapper Methods
A method identified as deprecated has been superseded and may become unsupported in the future.
Available in iOS 4.0 through iOS 4.3
addFileWithPath:
Creates a file wrapper from a given file-system node and adds it to the receiver, which must be a directory file wrapper. (Available in iOS 4.0 through iOS 4.3. Use addFileWrapper: instead.)
Parameters
- node
file-system node from which to create the file wrapper to add to the directory.
Return Value
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.
Special Considerations
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.
Availability
- Available in iOS 4.0 through iOS 4.3.
- Deprecated in iOS 4.0.
See Also
Declared In
NSFileWrapper.haddSymbolicLinkWithDestination:preferredFilename:
Creates 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. (Available in iOS 4.0 through iOS 4.3. Use addFileWrapper: instead.)
Parameters
- node
Pathname the new symbolic-link file wrapper is to reference.
- preferredFilename
Preferred filename for the new symbolic-link file wrapper.
Return Value
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.
Special Considerations
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.
Availability
- Available in iOS 4.0 through iOS 4.3.
- Deprecated in iOS 4.0.
See Also
Declared In
NSFileWrapper.hinitSymbolicLinkWithDestination:
Initializes the receiver as a symbolic-link file wrapper. (Available in iOS 4.0 through iOS 4.3. Use initSymbolicLinkWithDestinationURL: instead.)
Parameters
- node
Pathname the receiver is to represent.
Return Value
Initialized symbolic-link file wrapper referencing node.
Discussion
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.
Special Considerations
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:.
Availability
- Available in iOS 4.0 through iOS 4.3.
- Deprecated in iOS 4.0.
Declared In
NSFileWrapper.hinitWithPath:
Initializes a file wrapper instance whose kind is determined by the type of file-system node located by the path. (Available in iOS 4.0 through iOS 4.3. Use initWithURL:options:error: instead.)
Parameters
- node
Pathname of the file-system node the file wrapper is to represent.
Return Value
File wrapper for node.
Discussion
If node is a directory, this method recursively creates file wrappers for each node within that directory.
Special Considerations
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:.
Availability
- Available in iOS 4.0 through iOS 4.3.
- Deprecated in iOS 4.0.
Declared In
NSFileWrapper.hneedsToBeUpdatedFromPath:
Indicates whether the file wrapper needs to be updated to match a given file-system node. (Available in iOS 4.0 through iOS 4.3. Use matchesContentsOfURL: instead.)
Parameters
- node
file-system node with which to compare the file wrapper.
Discussion
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. |
Special Considerations
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:.
Availability
- Available in iOS 4.0 through iOS 4.3.
- Deprecated in iOS 4.0.
See Also
Declared In
NSFileWrapper.hsymbolicLinkDestination
Provides the pathname referenced by the receiver, which must be a symbolic-link file wrapper. (Available in iOS 4.0 through iOS 4.3. Use symbolicLinkDestinationURL instead.)
Return Value
Pathname the file wrapper references (the destination of the symbolic link the file wrapper represents).
Special Considerations
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.
Availability
- Available in iOS 4.0 through iOS 4.3.
- Deprecated in iOS 4.0.
Declared In
NSFileWrapper.hupdateFromPath:
Updates the file wrapper to match a given file-system node. (Available in iOS 4.0 through iOS 4.3. Use readFromURL:options:error: instead.)
Discussion
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.
Special Considerations
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:.
Availability
- Available in iOS 4.0 through iOS 4.3.
- Deprecated in iOS 4.0.
See Also
Declared In
NSFileWrapper.hwriteToFile:atomically:updateFilenames:
Writes a file wrapper’s contents to a given file-system node. (Available in iOS 4.0 through iOS 4.3. Use writeToURL:options:originalContentsURL:error: instead.)
Parameters
- node
Pathname of the file-system node to which the receiver’s contents are written.
- atomically
YESto write the file safely so that:An existing file is not overwritten
The method fails if the file cannot be written in its entirety
NOto overwrite an existing file and ignore incomplete writes.- updateNames
YESto 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.NOto specify that the receiver’s filenames not be updated. Use this in Save To operations.
Special Considerations
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:.
Availability
- Available in iOS 4.0 through iOS 4.3.
- Deprecated in iOS 4.0.
Declared In
NSFileWrapper.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-05-11)