Files and File System Structure - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Files and File System Structure

Description:

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 ... – PowerPoint PPT presentation

Number of Views:269
Avg rating:3.0/5.0
Slides: 18
Provided by: DanTh7
Category:
Tags: file | files | structure | system

less

Transcript and Presenter's Notes

Title: Files and File System Structure


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. /
  • EXTERN struct inode
  • mode_t i_mode / file type,
    protection, etc.
  • nlink_t i_nlinks / how many links
    to this file
  • uid_t i_uid / user id of the file's owner
  • gid_t i_gid / group number
  • off_t i_size / current file size in bytes
  • time_t i_atime / time of last access (V2
    only)
  • time_t i_mtime / when was file data last
    changed
  • time_t i_ctime / when was inode itself
    changed (V2 only)
  • zone_t i_zoneV2_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
Write a Comment
User Comments (0)
About PowerShow.com