1 / 17

Chapter 7

Chapter 7. Files and File System Structure. Files under LINUX. File: a sequence of bytes All files, I/O devices, and interfaces are treated as files Directories are also files (Files containing list of files within them). LINUX File Types. Simple/Ordinary file Directory

Download Presentation

Chapter 7

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. Chapter 7 Files and File System Structure

  2. Files under LINUX • File: a sequence of bytes • All files, I/O devices, and interfaces are treated as files • Directories are also files (Files containing list of files within them)

  3. LINUX File Types • Simple/Ordinary file • Directory • Symbolic (soft) link • Special File (device) • Character special • Block special • Named Pipe (FIFO)

  4. Filenames • Linux does not attach any particular meaning to any file • Application programs determine how to use files • Some applications require certain extensions, but LINUX does not use any standard convention for file extensions • Linux file names can be up to 255 characters (including any extension and the “.” before it) • It is permitted but generally unwise to embed special or invisible characters in file names

  5. Table 7.1 Commonly Used Extensions

  6. Figure 7.2  A typical LINUX file system structure

  7. Table 7.2 Main Subdirectories in /usr

  8. Table 7.2 Main Subdirectories in /usr

  9. Table 7.3 Some Important Hidden Files and Their Purposes

  10. Table 7.4 Summary of the Output of the ls -l Command

  11. Figure 7.1  Structure of a directory entry

  12. Figure 7.5  Contents of an inode

  13. Inode Structure • /* Inode table. This table holds inodes that are currently in use. In some cases they have been opened by an open() or creat() system call, in other cases the file system itself needs the inode for one reason or another, such as to search a directory for a path name. The first part of the struct holds fields that are present on the disk; the second part holds fields not present on the disk. The disk inode part is also declared in "type.h" as 'd1_inode' for V1 file systems and 'd2_inode' for V2 file systems. */ EXTERNstructinode { mode_ti_mode; /* file type, protection, etc. nlink_ti_nlinks; /* how many links to this file uid_ti_uid; /* user id of the file's owner gid_ti_gid; /* group number off_ti_size; /* current file size in bytes time_ti_atime; /* time of last access (V2 only) time_ti_mtime; /* when was file data last changed time_ti_ctime; /* when was inode itself changed (V2 only) zone_ti_zone[V2_NR_TZONES]; /* zone numbers for direct, ind, and dbl ind */ }

  14. Figure 7.6  Logical view of a disk drive(an array of disk blocks)

  15. Figure 7.7  Relationship between the file lab1.c in a directory and its contents on disk

  16. Figure 7.8  Relationship between a file descriptor and contents of the file on disk

  17. Figure 7.9  Relationship of a file descriptor and the corresponding file

More Related