O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSFileManager — Mac OS X 10.0

Synopsis

This class provides an interface that clients can use to interact with the filesystem. This provides all of the standard file and directory manipulation facilities for copying, moving, changing working directories, and more.

image with no caption

@interface NSFileManager : NSObject
                                  // Class Methods
   + (NSFileManager *)defaultManager;
                                  // Instance Methods
   - (BOOL)changeCurrentDirectoryPath:(NSString *)path;
   - (BOOL)changeFileAttributes:(NSDictionary *)attributes 
                                 atPath:(NSString *)path;
   - (NSArray *)componentsToDisplayForPath:(NSString *)path;
   - (NSData *)contentsAtPath:(NSString *)path;
   - (BOOL)contentsEqualAtPath:(NSString *)path1 
                                 andPath:(NSString *)path2;
   - (BOOL)copyPath:(NSString *)src 
                                 toPath:(NSString *)dest  
                                 handler:(id)handler;
   - (BOOL)createDirectoryAtPath:(NSString *)path 
                                 attributes:(NSDictionary *)attributes;
   - (BOOL)createFileAtPath:(NSString *)path 
                                 contents:(NSData *)data 
                                 attributes:(NSDictionary *)attr;
   - (BOOL)createSymbolicLinkAtPath:(NSString *)path 
                                 pathContent:(NSString *)otherpath;
   - (NSString *)currentDirectoryPath;
   - (NSArray *)directoryContentsAtPath:(NSString *)path;
   - (NSString *)displayNameAtPath:(NSString *)path;
   - (NSDirectoryEnumerator *)enumeratorAtPath:(NSString *)path;
   - (NSDictionary *)fileAttributesAtPath:(NSString *)path 
                                 traverseLink:(BOOL)yorn;
   - (BOOL)fileExistsAtPath:(NSString *)path;

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required