CocoaDev

Edit AllPages

NSFileManager lets you get file attributes with the method fileAttributesAtPath:traverseLink:. NSFileManager also defines an NSDictionary category that allows you to easily access individual attributes so you can do this:

    int fileSize = [fileAttributes fileSize]

instead of this:

    int fileSize = [fileAttributes objectForKey:NSFileSize]

Here’s the interface for the file attributes category additions to NSDictionary

@interface NSDictionary (NSFileAttributes)