file management
TRANSCRIPT
![Page 1: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/1.jpg)
Sir Kashif
Lecture 2: File Management
![Page 2: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/2.jpg)
provides the file abstraction for data storage guarantees data validity (most of the time) performance: throughput and response time enforces protection
![Page 3: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/3.jpg)
File Concept Access Methods Directory Structure File-System Mounting //skip File Sharing //skip Protection
![Page 4: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/4.jpg)
None - sequence of words, bytes Simple record structure
◦ Lines ◦ Fixed length◦ Variable length
Complex Structures◦ Formatted document◦ Relocatable load file
Can simulate last two with first method by inserting appropriate control characters
Who decides:◦ Operating system◦ Program
![Page 5: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/5.jpg)
Name – only information kept in human-readable form Identifier – unique tag (number) identifies file within file
system Type – needed for systems that support different types Location – pointer to file location on device Size – current file size Protection – controls who can do reading, writing,
executing Time, date, and user identification – data for
protection, security, and usage monitoring Information about files are kept in the directory structure,
which is maintained on the disk
![Page 6: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/6.jpg)
Create Write Read Reposition within file Delete Truncate //roundup/skip# Open(Fi) –open read/write session for Fi
◦ File pointer: pointer to last read/write location, Close (Fi) – close read/write session
![Page 7: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/7.jpg)
Set of files Used to organize files Translates external file names to internal file
names (file labels, i-nodes, file control blocks)
Treated as a file but with special operations
![Page 8: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/8.jpg)
Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system
![Page 9: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/9.jpg)
Efficiency – locating a file quickly Naming – convenient to users
◦ Two users can have same name for different files
◦ The same file can have several different names
Grouping – logical grouping of files by properties, (e.g., all Java programs, all games, …)
![Page 10: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/10.jpg)
Sharing of files on multi-user systems is desirable
Sharing may be done through a protection scheme
On distributed systems, files may be shared across a network
Network File System (NFS) is a common distributed file-sharing method
![Page 11: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/11.jpg)
User IDs identify users, allowing permissions and protections to be per-user
Group IDs allow users to be in groups, permitting group access rights
![Page 12: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/12.jpg)
File owner/creator should be able to control:◦ what can be done◦ by whom
Types of access◦ Read◦ Write◦ Execute◦ Append◦ Delete◦ List
![Page 13: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/13.jpg)
•File AllocationProtection Mechanisms
![Page 14: File Management](https://reader036.vdocuments.mx/reader036/viewer/2022081403/55499d2eb4c905fa728b4aa8/html5/thumbnails/14.jpg)