Download as PPTX, PDF, TXT or read online from Scribd
Download as pptx, pdf, or txt
You are on page 1of 8
02
Director y Single-Level Directory Systems
Introduction to Single-Level Directory
Systems: -Contains 4 files: This directory system is simple, featuring only 4 files stored within a root directory. - Owned by 3 different people (A, B, and C): Each file belongs to one of the three users, facilitating easy ownership distinction and file management. Single-Level Directory Systems
Strengths Weaknesses
-Easy to manage due to the lack -Difficult organization as the
of multiple directory levels. number of files increases. - Suitable for small - Lacks flexibility in applications or personal use. permissions and management. Two-Level Directory Systems * Introduction:
-Contains 4 files: This directory system is
simple, featuring only 4 files stored within a root directory. - Owned by 3 different people (A, B, and C): Each file belongs to one of the three users, facilitating easy ownership distinction and file management. Two-Level Directory Systems Benefits
- Improved organization and
classification of files. - Easier to expand when adding new users or files. => The two-level directory system is an effective solution for file management in environments with multiple users, enhancing security and organization. Hierarchical Directory Systems Structure : - The system features a root directory at the top level. - Below the root, user directories are organized into subdirectories. Organization: User - Each user (e.g., A, B, C) has their own directory, which can contain further subdirectories and files. - This structure allows users to organize their files logically. Path Names Structure : - The root directory is at the top, denoted as /. - Various subdirectories such as bin, etc, usr, and tmp branch out from the root. Subdirectory Details: Each subdirectory can contain files and additional nested subdirectories, illustrated with names like ast, lib, and dict. A UNIX directory tree Directory Operations 1. Create: Establishes a new directory within the filesystem. 2. Delete: Removes an existing directory, along with its contents if specified. 3. Opendir: Opens a directory stream for reading its contents. 4. Closedir: Closes a previously opened directory stream to free resources. 5. Readdir: Reads the entries within a directory, typically returning the names of files and subdirectories. 6. Rename: Changes the name of an existing directory, allowing for better organization. 7. Link: Creates a hard link to a file or directory, enabling multiple references to the same data. 8. Unlink: Removes a link to a file or directory, effectively deleting it if no links remain.