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;

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.