


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



CS423UG Operating Systems
CS 423UG Operating Systems,
Indranil Gupta
Content
CS 423UG Operating Systems,
Indranil Gupta
Question for You
CS 423UG Operating Systems,
Indranil Gupta
What’s the problem with Files?
CS 423UG Operating Systems,
Indranil Gupta
File System Requirements
CS 423UG Operating Systems,
Indranil Gupta
File Concepts
CS 423UG Operating Systems,
Indranil Gupta
File Attributes
Name:
symbolic file name, human-readable form. Many OS’s
support two part file names (filename.filetype, e.g., foo.txt)
Type:
Regular files - user information, regular files are generally eitherbinary (e.g., .exe) or ASCII (e.g., all .cpp, all .txt)
Directories - system files for maintaining the structure of the filesystem
Character special files - related to input/output and used to modelserial I/O devices such as terminals, printers, and networks
Block special files - used to model disks
Location:
(1) pointer to a device and (2) pointer to the location
of the file on that device
Size:
current size and maximal possible size
Protection:
Access-control information, who can read, who can
write
Time, date, user identification
: creation time, last modification
time, last use time
CS 423UG Operating Systems,
Indranil Gupta
File Operations
creat() or fopen()
fwrite()
fread()
lseek()
del or rm
cat
cp or mv
CS 423UG Operating Systems,
Indranil Gupta
File Structures
Unstructured sequence of bytes
Fixed or variable length
Read or write a number of records
Records with keys
Read, insert, delete a record (typically using B-tree)
CS 423UG Operating Systems,
Indranil Gupta
File Structures Today
CS 423UG Operating Systems,
Indranil Gupta
File Types
sizes, entry point, flags
Text (code)
Data
relocation bits
symbol table
CS 423UG Operating Systems,
Indranil Gupta
CS 423UG Operating Systems,
Indranil Gupta
Reading And Writing
CS 423UG Operating Systems,
Indranil Gupta
Reading A Block
PCB Open
file table
Metadata
Logical
physical
Get physical block to sysBuf
copy to userBuf
Disk device driver
Buffer cache
CS 423UG Operating Systems,
Indranil Gupta
Reminders