1 / 7

Directory Tree

Directory Tree. Path Names (cont.). cp usr/ast/mailbox usr/ast/mailbox .bak and cp mailbox maibox.bak

mandana
Télécharger la présentation

Directory Tree

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Directory Tree

  2. Path Names (cont.) • cp usr/ast/mailboxusr/ast/mailbox.bak • and • cp mailbox maibox.bak • do the same thing if the working directory is /usr/ast. The relative form is often more convenient, but it and the absolute form does the same thing. Some programs need to access a specify file without regard to what the working directory is. That's why the absolute path names should always be used. It will work no matter what the working directory is. In most systems, each process has it own working directory, so when a process changes its work directory and later exits, no other process are affected and no traces left behind in the file system. Operating systems that support the hierarchical directory system have two special entries in every directory, "." and ".." which is general pronounced dot and dot dot. It saves the user the trouble of typing entries a second time.

  3. Directory Operations (cont.) • 5. READDIR This call returns the next entry in an open directory. • 6. RENAME In some ways directories are just like and can be rename. • 7. LINK is a technique that allows a file to appear in more than one directory. • 8 UNLINK A directory entry is removed.

  4. Directory Operations • In directory operations the allowed system calls for managing directories exhibit more variation from system than system than system calls for files. These are the most important, but there are an few other as well. • 1. CREATE A directory is created. • 2. DELETE A directory is deleted. • 3. OPENDIR Directories can be read. • 4. CLOSEDIR After a directory is read, it should be closed to free up internal table space.

  5. Path Names • In these directory trees some way is needed for specifying file names. One method is an absolute path name consisting of the path from the root directory to the file. For example in ; • /usr/ast/mailbox • means the root directory contains subdirectory usr it contains subdirectory ast that contains file mailbox. The other method is the relative path name, which is used in conjunction with the concept of the working directory. In the working directory usr/ast/mailbox is simple refered to as mailbox. So, in the UNIX command  

  6. Hierarchical Directory • The simplest organization is for the system to maintain a single directory containing all the files of all the users. However, if the system is used by many users this may cause conflict and confusion. A better organization is to have a single directory with all the files in the entire system is to have one directory per user, which will eliminate conflicts and confusion. This type of organization is called a directory tree.

  7. Directories • Directories are systems designed to keep track of files. The data structure of a directory typically contains a number of entries, one per file. Another way is a directory entry holds the file name and a pointer to another data structure where the attributes and the disk addresses are found.

More Related