August 2011
Intermediate to advanced
552 pages
23h 48m
English
NSFileManager also abstracts out a number of common file operations, such as copying, moving, removing, and linking items. As expected, there are two API families: one using string paths and the other using URLs.
You can use the following methods to copy, move, (hard) link, and remove files and directories:
- (BOOL) copyItemAtPath: (NSString *) srcPath toPath: (NSString *) dstPath error: (NSError **) error;
- (BOOL) moveItemAtPath: (NSString *) srcPath toPath: (NSString *) dstPath error: (NSError **) error;
- (BOOL) linkItemAtPath: (NSString *) srcPath toPath: (NSString *) dstPath error: (NSError **) error;
- (BOOL) removeItemAtPath: (NSString *) path error: (NSError **) error;
These methods will potentially ...
Read now
Unlock full access