File System
o Also referred to as simply a file system or filesystem.
o The system that an operating system or program uses to organize and keep track of files.
o For example, a hierarchical file system is one that uses directories to organize files into a tree structure.
o Although the operating system provides its own file management system, you can buy separate file management systems.
o These systems interact smoothly with the operating system but provide more features, such as improved backup procedures and stricter file protection.
File Sharing
o Sharing of files on multi-user systems is desirable
o Sharing may be done through a protection scheme
o On distributed systems, files may be shared across a network
o Network File System (NFS) is a common distributed file-sharing method
File Sharing – Multiple Users
o User ID's identify users, allowing permissions and protections to be per-user
o Group ID's allow users to be in groups, permitting group access rights
File Sharing – Failure Modes
o Remote file systems add new failure modes, due to network failure, server failure
o Recovery from failure can involve state information about status of each remote request
o Stateless protocols such as NFS include all information in each request, allowing easy recovery but less security
File Sharing – Consistency Semantics
o Consistency semantics specify how multiple users are to access a shared file simultaneously
ú Similar to process synchronization algorithms
- Tend to be less complex due to disk I/O and network latency (for remote file systems)
ú Andrew File System (AFS) implemented complex remote file sharing semantics
ú Unix file system (UFS) implements:
- Writes to an open file visible immediately to other users of the same open file
- Sharing file pointer to allow multiple users to read and write concurrently
- Writes only visible to sessions starting after the file is closed
File-system Organization
o Search for a file
o Create a file
o Delete a file
o List a directory
o Rename a file
o Traverse the file system
Single-Level Directory
o A single directory for all users
Naming problem
Grouping problem
Two-Level Directory
o Separate directory for each user
o Path name
o Can have the same file name for different user
o Efficient searching
o No grouping capability
Tree-Structured Directories
o Efficient searching
o Grouping Capability
o Current directory (working directory)
o cd /spell/mail/prog
o type list
File Map
o File mapping is the association of a file's contents with a portion of the virtual address space of a process.
o The system creates a file mapping object (also known as a section object) to maintain this association.
o A file view is the portion of virtual address space that a process uses to access the file's contents.
o File mapping allows the process to use both random input and output (I/O) and sequential I/O.
o It also allows the process to work efficiently with a large data file, such as a database, without having to map the whole file into memory.
o Multiple processes can also use memory-mapped files to share data.
o Processes read from and write to the file view using pointers, just as they would with dynamically allocated memory.
o The use of file mapping improves efficiency because the file resides on disk, but the file view resides in memory.
o Processes can also manipulate the file view with the VirtualProtect function.
Open File Locking
o Provided by some operating systems and file systems
o Mediates access to a file
o Mandatory or advisory:
o Mandatory – access is denied depending on locks held and requested
o Advisory – processes can find status of locks and decide what to do





