1/66
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
File
Storage that is logically named (identified) and persistent.
What sequence makes up a file?
A byte sequence wherein each byte is 8 bits.
What sequence makes up records?
The sequence can be of any size.
How can an extension be used to determine the type of a file?
Extensions tell the computer which application created or can open the file, and which icon to use for the file.
How can a 'magic number' be used to determine the type of a file?
A magic number is a numeric or string constant that indicates the file type.
Where is the 'magic number'?
It is located in the first 512 bytes of the file.
What is an advantage of using the 'magic number' of a file?
Searching complicated file structures can be avoided; this makes it easier to identify the file type.
File Attribute
An element that describes a characteristic of a file and provides information that system needs to handle the file.
What are examples of file attributes?
Title, record size, number of areas, and date of creation.
Where are permanent file attributes values stored in disk files?
In the disk file header.
Why don't we determine the type of a file by looking at its contents?
It can be more computationally costly and less precise.
File Control Block (FCB)
A file system structure in which the state of a file is maintained; stores the attributes and location information of a file.
File Descriptor
An FCB loaded to memory.
What are some pieces of information contained in the FCB?
The ownership, size, permissions, dates, and more.
How is information about a file stored in UNIX?
In index nodes, also known as i-nodes.
What is a file descriptor used for?
To maintain the status of a data file that is being created or manipulated.
What determines how a file can be accessed?
The media type.
Sequential Access
Bytes must be accessed/navigated in linear order.
What types of media allow for sequential access?
Tapes and pipes.
Random Access
Data can be accessed in any (random) order. Data cursor can be moved via seek operation.
What types of media allow for random access?
HDD
SSD
Floppy Disks
Why did files begin to be organized by user?
Because as time went on, multiple users began sharing the same machine.
Directory/Folder
A special file type that holds (part of) the FCB about other files in Windows systems. In Unix systems, directories point to i-nodes.
How is a directory file distinguished?
It is usually marked as such via an attribute in its FCB.
Single, Shared Directory
There is one root directory and its children are files.
One Directory per User
There is one root directory, and its children are user directories. The children of the user directories are files.
Freeform or Nested Directory
The children of the root directory are user directories. From there, the children of user directories can be more user directories or files.
What are some common directory operations?
Create, read, delete, rename, open, close, link, and unlink.
Shared File
A file can be added to (shared by) more than one directory via a file system link.
How is a shared file implemented?
The shared files point to the same i-node, as they have the same i-node number.
Index Node or I-Node
Data structure that stores metadata about a file or directory, excluding its name and actual data content.
What information is typically included within an index node?
File type, file mode and permissions, file owner and group, file size, timestamps, number of hard links, pointers to data blocks, file system identifier, and i-node number.
File Type
Indicates whether the i-node represents a regular file, directory, symbolic link, device file, socket, or named pipe.
File Mode and Permissions
Permissions for the file (RWE), for the owner, group, and others.
File Owner and Group
The user ID (UID) and group ID (GID) of the file's owner and group.
File Size
The size of the file in bytes.
Timestamps
The three timestamps associated with the file: LAT, LMT, LCST.
Regular or Hard Links
A directory entry that associates a file name with an i-node; holds the reference (i-node) of the target file.
Where can hard links be used?
Within the same file system.
What happens when a hard link is removed?
It does not affect other links.
What happens when the name of the file associated with a hard link is changed?
Nothing happens as the link is not affected.
What happens when a hard link is used with a directory?
A hard link cannot be used with directories.
Symbolic or Soft Link
Contains the path for the original file and not the contents (pointers to file names).
What can a soft link link to?
A directory.
What can a soft link be linked across?
A soft link can be linked across different file systems.
What happens to the soft link if the original file is deleted or moved?
The soft linked file will not work correctly (hanging link or linking rot).
Link
A pointer to a file or directory.
What happens if the source of a hard link is moved or removed?
Nothing.
Why will a soft link stop working if the original file is renamed, deleted, or moved?
Soft links are not updated; they merely contain a string which is the path name of its target.
Why will a hard link continue working if the original file is renamed or moved?
Because each hard linked file is assigned the same i-node value as the original, they reference the same physical file location.
What is the size of a hard link?
The size of the original file.
What happens in the process of creating a file?
A hard link between the new file and the directory is created.
What happens in the process of deleting a file?
A file is unlinked.
What does the link count mean?
It represents how many links there are to the file.
What is the minimum link count of each existing file?
One.
Where is the hard link count stored?
In the i-node.
What happens to the hard link count on a successful link system call?
It increases by one.
What happens to the hard link count on an unsuccessful link system call?
It decreases by one.
What strategy is used to prevent deletion mid-operation?
The link count is incremented when a file is opened.
When is a file considered deleted?
When the link count reaches zero.
How can one find all the hard links to the same file?
Go through the entire filesystem comparing i-node numbers.
Why can linking or unlinking fail?
Due to permissions, existence, and other issues such as a lack of disk space.
Files system need to store information in a...
...persistent way (survives process termination)
File systems need to locate...
...free storage space
File systems need to allow more than one process to...
...access the information store concurrently
Tape backups are still widely used by large enterprises because of their...
longevity
Directory
Special file type that holds (part of) the FCB about other files