Directory Separator Characters

If you look at the organizational chart presented earlier in this hour, you can see that employees are identified simply as “employee” where possible. Because each has a unique path upwards to the president, each has a unique identifier if all components of the path upward are specified.

For example, the rightmost of the four employees could be described as “Employee managed by Jr. Manager 4, managed by Senior Manager 3, managed by Vice-President 2, managed by the President.” Using a single character, instead of “managed by,” can considerably shorten the description: Employee/Jr. Manager 4/Senior Manager 3/Vice-President 2/President. Now consider the same path specified from the very top of the organization downward: President/Vice-President 2/Senior Manager 3/Jr. Manager 4/Employee.

Because only one person is at the top, that person can be safely dropped from the path without losing the uniqueness of the descriptor: /Vice-President 2/Senior Manager 3/Jr. Manager 4/Employee.

In this example, the / (pronounce it “slash”) is serving as a directory separator character, a convenient shorthand to indicate different directories in a path.

The idea of using a single character isn't unique to UNIX, but using the slash is unusual. On the Macintosh, the system uses a colon to separate directories in a pathname. (Next time you're on a Mac, try saving a file called test:file and see what happens.) DOS uses a backslash: DOS indicates the DOS directory at the top level. The characters /tmp indicate the tmp directory at the top level of the UNIX file system, and :Apps is a folder called Apps at the top of the Macintosh file system.

On the Macintosh, you rarely encounter the directory delineator because the system has a completely graphical interface. Windows also offers a similar level of freedom from having to worry about much of this complexity, although you'll still need to remember whether “A:” is your floppy disk or hard disk drive.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset