linkPath:toPath:handler:
Creates a link from a source to a destination.
Declaration
- (BOOL) linkPath:(NSString *) src toPath:(NSString *) dest handler:(id) handler;Parameters
- src:
A path that identifies a source file or directory.
The file, link, or directory specified by
sourcemust exist. - dest:
A path that identifies a destination file or directory.
The destination should not yet exist. The destination path must end in a filename; there is no implicit adoption of the source filename.
- handler:
An object that responds to the callback messages Filemanager(_:willprocesspath:) and Filemanager(_:shouldproceedaftererror:). You can specify
nilforhandler; if you do so and an error occurs, the method automatically returns False.
Return Value
true if the link operation is successful. If the operation is not successful, but the handler method fileManager(_:shouldProceedAfterError:) returns true, also returns true. Otherwise returns false.
Discussion
The handler callback mechanism is similar to delegation. NSFileManager sends fileManager(_:willProcessPath:) when it begins a copy, move, remove, or link operation. It sends fileManager(_:shouldProceedAfterError:) when it encounters any error in processing
Special Considerations
Because this method does not return error information, it has been deprecated as of OS X v10.5. Use removeItem(atPath:) instead.
See Also
Related Documentation
linkItem(at:to:)moveItem(atPath:toPath:)createSymbolicLink(atPath:withDestinationPath:)copyItem(atPath:toPath:)removeItem(atPath:)
Deprecated Methods
copyPath:toPath:handler:movePath:toPath:handler:removeFileAtPath:handler:changeFileAttributes(_:atPath:)fileAttributes(atPath:traverseLink:)fileSystemAttributes(atPath:)directoryContents(atPath:)createDirectory(atPath:attributes:)createSymbolicLink(atPath:pathContent:)pathContentOfSymbolicLink(atPath:)fileManager(_:shouldProceedAfterError:)fileManager(_:willProcessPath:)