Changes

Jump to: navigation, search

Working with Directories on iPhone OS

12 bytes added, 19:11, 18 May 2010
Getting the Attributes of a File or Directory
The attributes of a file or directory can be obtained using the ''attributesOfItemAtPath'' method. This takes as arguments the path of the directory and an optional NSError object into which information about any errors will be placed (may be specified as NULL if this information is not required). The results are returned in the form of an NSDictionary dictionary object. The keys for this dictionary are as follows:
<pre>
NSFileType
NSFileTypeDirectory
NSFileOwnerAccountID
NSFileGroupOwnerAccountID
</pre>
For example, we can extract the file type and POSIX permissions for the /Applications directory using the following code excerpt:

Navigation menu