O'Reilly logo

Learning Perl, Fourth Edition by brian d foy, Tom Phoenix, Randal L. Schwartz

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

Links and Files

To understand more about what’s going on with files and directories, it helps to understand the Unix model of files and directories even if your non-Unix system doesn’t work in this way. As usual, there’s more to the story than we’ll explain here, so check any good book on Unix internal details if you need the full story.

A mounted volume is a hard disk drive (or something else that works, more or less, like that, such as a disk partition, a floppy disk, a CD-ROM, or a DVD-ROM). It may contain any number of files and directories. Each file is stored in a numbered inode, which we can think of as a particular piece of disk real estate. One file might be stored in inode 613, and another in inode 7033.

To locate a particular file, we’ll have to look it up in a directory. A directory is a special kind of file, maintained by the system. Essentially, it is a table of filenames and their inode numbers.[284] Along with the other things in the directory, there are two special directory entries. One is . (called “dot”), which is the name of that directory; and the other is .. (“dot-dot”), which is the directory one step higher in the hierarchy (i.e., the directory’s parent directory).[285] Figure 12-1 provides an illustration of two inodes. One is for a file called chicken, and the other is Barney’s directory of poems, /home/barney/poems, which contains that file. The file is stored in inode 613 and the directory is stored in inode 919. (The directory’s own name, poems, doesn’t ...

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