12Files, Part 2: Directories, File Systems, and Links

Directories are the counterparts to files. Files are containers of information, while directories are containers of files. Directories can be nested inside of other directories, giving the hierarchical structure to the file system. The file system itself is conceptually built upon data blocks which store information, and inodes that store metadata. Both files and directories make use of data blocks and inodes. Links (hard links and symbolic links) allow a file or directory to appear in more than one location.

Directories

Compared to files, there is very little that can be done to directories. You can create them, remove them, and iterate through their contents.

Creation and destruction

int ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide 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.