File Concept Access Methods Directory Structure File System Mounting File Sharing Protection
File Concept Access Methods Directory Structure File System Mounting File Sharing Protection
File Concept Access Methods Directory Structure File System Mounting File Sharing Protection
File Concept
Contiguous logical address space Types:
Data
numeric character binary
Operating System Concepts FAROOQ
Program
File Structure
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
File Attributes
Name only information kept in human-readable form. 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.
File Operations
Create Write Read Reposition within file file seek Delete Truncate Open(Fi) search the directory structure on disk for entry Fi, and move the content of entry to memory. Close (Fi) move the content of entry Fi in memory to directory structure on disk.
Access Methods
Sequential Access read next write next reset no read after last write (rewrite) Direct Access
Operating System Concepts FAROOQ
Sequential-access File
Directory Structure
A collection of nodes containing information about all files.
Directory
Operating System Concepts FAROOQ
Files
F1
F2
F3
F4 Fn
Both the directory structure and the files reside on disk. Backups of these two structures are kept on tapes.
Grouping logical grouping of files by properties, (e.g., all Java programs, all games, )
Single-Level Directory
A single directory for all users.
Two-Level Directory
Separate directory for each user.
Path name Can have the same file name for different user Efficient searching No grouping capability
Tree-Structured Directories
Acyclic-Graph Directories
Have shared subdirectories and files.
Mount Point
File Sharing
Sharing of files on multi-user systems is desirable. Sharing may be done through a protection scheme.
Operating System Concepts FAROOQ
On distributed systems, files may be shared across a network. Network File System (NFS) is a common distributed filesharing method.
Protection
File owner/creator should be able to control:
what can be done by whom
Operating System Concepts FAROOQ
Types of access
Read Write Execute Append Delete List