File System Interface Flashcards
What is a file?
Abstraction over physical device. File is a logical unit of storage with variable length.
What are attributes of a file?
- Name
- Identifier
- Type
- Location
- Size
- Protection
- Time, date and user identification
What operations can be performed on files?
Read, write, repostion
- per-process file position pointer
Create, delete, truncation
How can we prepare a file for use?
File must be opened using a syscall. Directory structure is searched for a specified file.
File is added to the open file table and returns pointer to its entry on the table.
What are the open file tables?
System-wide open file table
Per-process open file table
What does the System-wide open file table show?
All currently open files, and what processes have them open
What does the per-process open file table show?
- Files that a process has open
- Entries point to the System-wide open file table entries.
- Current FP value for the process.
- Access mode (R/W)
What locks can be place on a file?
Shared lock (Reader lock)
Exclusive lock (Writer lock)
Controls access to shared files.
What do file types fo?
Can infer its use, however still appears as bytes to OS.
What access methods are there for files?
- Sequential access
- Direct access
How does sequential access operate?
Read from or write to current position in file and advance the file pointer
How does direct access operate?
Interacts with the file on block level. Random access supported by disks.
How is storage structures?
Storage volumes: Device for storage.
File system may take up entire device.
Devices may be sub-divided into partitions: 1 device with multiple volumes.
How are directories structured?
Hierarchical naming, files and directories can be referenced by path name.
Relative, in current dir. Absolute, path from /
What are the attributes of an acyclic directory structures?
Can have multiple paths for same file/dir.
Space can only be reclaimed when last reference to file is deleted.