Three desirable properties of files.
Long-term existence; sharable between processes; structure.
What does a file management system consist of?
System utility programs that run as privileged applications; it is concerned with secondary storage.
Typical file operations.
Create, delete, open, close, read, write.
Name four objectives of a file management system.
Any four of: meet users' data management needs; guarantee the data are valid; optimize performance; I/O support for a variety of storage devices; minimize lost or destroyed data; standardized I/O interface routines; I/O support for multiple users.
Five criteria for file organisation.
Short access time; ease of update; economy of storage; simple maintenance; reliability.
Five file organisation types.
Pile; sequential file; indexed sequential file; indexed file; direct, or hashed, file.
Who owns the directory, and what mapping does it provide?
The directory itself is a file owned by the operating system; it provides the mapping between file names and the files themselves.
Which directory elements are address information?
Volume (device on which the file is stored), starting address, size used, size allocated.
Size used vs size allocated.
Size used: the current size of the file in bytes, words, or blocks. Size allocated: the maximum size of the file.
Give four usage-information directory elements.
E.g., date created, identity of creator, date last read access, identity of last reader, date last modified, identity of last modifier, date of last backup, current usage.
Two problems of the simple list directory.
It provides no help in organizing the files and forces the user to be careful not to use the same name for two different files.
Two-level directory scheme: structure and limitation.
One directory per user plus a master directory (entry per user with address and access control information); it does not provide structure for collections of files.
When are duplicate filenames possible?
In a tree-structured directory, if they have different pathnames.
The two issues of file sharing.
Access rights; management of simultaneous access.
Execution vs reading access right.
Execution: the user can load and execute a program but cannot copy it. Reading: the user can read the file for any purpose, including copying and execution.
Appending vs updating access right.
Appending: add data but cannot modify or delete any contents. Updating: modify, delete, and add to the file's data.
The four user classes.
Owner, specific users, user groups, all.
Records vs blocks.
Records are the logical unit of access of a structured file; blocks are the unit for I/O with secondary storage.
Where is the internal fragmentation in fixed blocking?
The unused space at the end of a block.
How is a record continued in variable-length spanned blocking?
By a pointer to the successor block.
Why does unspanned blocking waste space?
The remainder of a block cannot be used if the next record is larger than the remaining unused space.
Why do users tend to overestimate file size with preallocation?
It is difficult to reliably estimate the maximum potential size of the file, so they overestimate so as not to run out of space.
Portion size: the two extremes and the trade-off.
A portion large enough for the entire file, or one block at a time; a trade-off between single-file efficiency and overall system efficiency.
Contiguous allocation: FAT entry and problem.
A single entry with the starting block and length of the file; external fragmentation will occur, so compaction is needed.
Chained allocation: how are blocks linked, and what is it best for?
Each block contains a pointer to the next block in the chain; no external fragmentation; best for sequential files.
What does the file allocation table hold with indexed allocation?
The block number for the file's index; the one-level index has one entry for each portion allocated to the file.
Indexed allocation: fixed-size vs variable-sized blocks.
Allocating by (fixed-size) blocks eliminates external fragmentation; variable-sized blocks improve locality; both require occasional consolidation.