Filing Flashcards

1
Q

What are the different levels of storage in a typical computer?

A

The different levels of storage in a typical computer are: Processor registers, Primary memory (RAM), Secondary storage (disks), and Network.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the user’s perspective on storage levels?

A

From the user’s perspective, the storage levels are: Internal context (registers, etc.), Memory, Filestore, and Internet.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the advantages of using file-store for large capacity storage?

A

The advantages of using file-store for large capacity storage are: storing items as files rather than individual bytes, larger storage capacity compared to main memory, and support for inter-process communication.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which technologies are commonly used for persistent secondary storage?

A

The chief contemporary technologies for persistent secondary storage are: Magnetic disk (HDD), Flash memory (SSD), and Optical disc (e.g., DVD).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does access rights differ between primary storage and file-store?

A

In primary storage, threads within a process have common access to memory, while processes are isolated from each other. In file-store, files provide a means of communication between processes and are not owned by a specific process. Access control systems for files are typically more sophisticated than for primary memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the role of the filing system in relation to files and devices?

A

The filing system acts as a common software layer between user applications that handle files and the disk (or other) device drivers. It ensures that all processes see the same files and provides system calls for accessing files without harmful interactions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the typical structure of a modern file-store?

A

A modern file-store is hierarchical with a tree-like structure of arbitrary depth. Each tree has a single root, and branching points are directories. Terminal points on the tree are files containing data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What files are found in every Unix directory?

A

Every Unix directory contains at least two files: “.” and “..”. The file “.” refers to the current directory, while “..” refers to the parent directory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between the filing system and the file system?

A

The filing system refers to the overall system that manages files, while the file system is a component of the filing system. The file system is responsible for organizing and storing files on a specific storage device.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can a ‘memory stick’ illustrate the concept of a file system?

A

A ‘memory stick’ can contain its own file system, which may or may not be implemented in the same way as the file system on a hard disk drive. In a Windows system, a ‘memory stick’ appears as a separate device, allowing easy transfer of files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a volume in the context of file systems?

A

In the context of file systems, a volume refers to a logical drive. It is often associated with a disk partition, although it is not mandatory. Each volume may have its own file system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is it sometimes useful to be aware of the volume in which a file resides?

A

Being aware of the volume in which a file resides can be useful because moving a file within a volume is typically a simple renaming process. However, moving a file between volumes involves copying all the bytes, which can be time-consuming for large files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the impact of increasing storage capacity on file systems?

A

Increasing storage capacity has led to a variety of file system choices, some of which have become obsolete over time. As storage devices have evolved, the capacity to store files has increased significantly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a file in a filing system?

A

A file is the basic storage unit in a filing system. It is a collection of data that is large but slow to access compared to main memory. Files can be accessed by multiple users and processes and are permanent.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is required to access a file in a filing system?

A

Accessing a file typically requires the appropriate sequence of system calls and is subject to access permissions. The file system provides a set of system calls for reading from and writing to files, ensuring controlled access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does a file consist of in a filing system?

A

Each file consists of a standard set of file attributes, such as the file size, and a variable number of blocks or clusters that contain the actual data. While it is common to keep only one type of data in each file, it is not compulsory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How is the data within a file structured in most modern file systems?

A

In most modern file systems, the data within a file is considered as a large array of bytes. While some file systems may provide structuring options, such as organizing data into records, it is generally left to the user’s preference.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

How are files typically accessed for reading or writing?

A

When reading or writing a file, there is an associated position that is maintained by the access process. It is possible to have multiple processes reading the same file at different positions simultaneously. Moving the read/write position often requires a sequence of system calls.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is the purpose of a file name in a filing system?

A

A file has a unique identifier, but the user typically associates a human-readable name with it for identification. This file name may or may not be part of the file’s attributes. For example, in a Unix filing system, the file name is separate from the file, and one file can have multiple different names.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What are file attributes in a filing system?

A

File attributes are metadata associated with a file, providing information about the file itself rather than its contents. They include details such as the file’s size, creation date, and permissions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

How can you view file attributes in a Unix system?

A

In Unix, you can use the command “ls -l” to see important attributes of files in a directory. For more detailed information about a specific file, you can use the command “stat <filename>".</filename>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the purpose of file permissions?

A

File permissions determine what actions can be performed on a file, such as reading, writing, or executing. They serve as a simple form of protection against unintended modifications or unauthorized access.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How does Unix handle file permissions?

A

Unix provides independent control over read, write, and execute permissions for a file. It also allows setting permissions for different users or user groups. For example, certain files may be readable by all users but writeable only by staff members.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Why is file ownership important in a multi-user system?

A

In a multi-user system, file ownership helps identify which user “owns” a particular file. It provides a means to determine responsibility and manage access permissions. The owner’s unique identifier can be used to look up the associated user’s name if needed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is the concept of a “group” in Unix file ownership?

A

In Unix, a file can also belong to a “group” in addition to having an owner. This allows for additional access settings specifically for members of that group. Generally, the access permissions for the group are more liberal compared to those for “others,” who are not the owner or part of the group.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

How are different file types classified within a filing system?

A

Different file types can be classified based on various criteria within a filing system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

How are file types displayed in Unix or Windows directories?

A

Unix and Windows directories display filenames that may not immediately distinguish regular files from subdirectories to the user. The filing system keeps this distinction within the file attributes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What are some examples of different file types in a Unix-like system?

A

In a Unix-like system, different file types may include: “l” for symbolic link, “p” for named pipe, “s” for socket, “c” for character device, and “b” for block device.

29
Q

How does Unix classify different file types?

A

In Unix, all different file types, such as audio files, photographs, text documents, and compiled program binaries, are considered “regular files.” However, some filing systems include additional attributes to provide more information on how to process a file.

30
Q

How do file browsers determine the content of a file?

A

File browsers and similar tools attempt to deduce the content of a file. They use a combination of filesystem tests, magic tests (checking for specific patterns in the file), and language tests (analysing the file’s structure and keywords) to classify the file type.

31
Q

How do users often imply the type of a file?

A

Users often imply the type of a file by its name, typically using a suffix extension. For example, a “text” file may have a name like “file.txt.” However, in modern systems like Unix and Windows, the file extension is purely for human convenience and is not logically separate from the file name or metadata.

32
Q

What is the purpose of access control in file systems?

A

Access control in file systems provides security and safety measures by determining permissions for different users and processes to read, write, and execute files. It helps protect against intrusion and accidental modifications.

33
Q

What are the three classes of file access permission in Unix-like systems?

A

The three classes of file access permission in Unix-like systems are: the owner (UID), the group (GID), and any system user. Each class has permissions for reading, writing, and executing files.

34
Q

What are the permissions for a regular file in Unix?

A

In Unix, read permission allows clients to view the file’s content, write permission allows clients to modify the file’s content, and execute permission allows clients to run the file as code.

35
Q

How are file permissions similar to memory access permissions?

A

File permissions, like memory access permissions, provide security against intrusion and safety against accidents. They control the level of access to files and ensure that files are not accidentally modified or deleted.

36
Q

How can you view a file’s permissions in Unix?

A

In Unix, you can use the command “ls -ls” to view a file’s permissions. The permissions are displayed as a combination of type and permission information.

37
Q

What is umask in Unix file systems?

A

In Unix file systems, umask is a default set of file permissions for files created by each process. It prevents specified file permission bits from being set and can be inherited from parent processes but can also be altered locally.

38
Q

Can you delete a file in a Unix file system if you don’t have write permission?

A

Sometimes. If you have write permission on the directory containing the file, you can remove the file from that directory. If it is the last link to the file, the file will be deleted.

39
Q

What is an Access Control List (ACL) in file systems?

A

An Access Control List (ACL) is a more sophisticated means of controlling file permissions. It is a feature in the latest Windows and some Unix file systems and allows for more selective permission control than single groups. The ACL contains entries specifying file access permissions for each user.

40
Q

What is role-based access control in file systems?

A

Role-based access control allows specific individuals to have different levels of access and permissions to a record. It provides fine-grained control, allowing individuals to modify certain fields, read others, and restrict access to certain information. This goes beyond basic file permissions in an operating system.

41
Q

What is used by users to identify files in operating systems?

A

Users typically identify files with filenames or paths to a file.

42
Q

What is a file handle in the context of file systems?

A

A file handle is an abstract identifier or reference that allows a user to identify a particular file. It is associated with a file descriptor of a file that is in use.

43
Q

What is the purpose of opening a file in file systems?

A

The first step in working with a file is to open it. Opening a file fetches a block of the file into a buffer, which prevents frequent disk accesses for read operations. It establishes access permissions and sets the file’s internal position pointer to the start or end, depending on the mode.

44
Q

What are some examples of things that can be mapped to look like files in operating systems?

A

Streams, pipes, and devices are some examples of things that can be mapped to “look like” files in operating systems. They can be accessed using the same device-independent interface as true files.

45
Q

What are the common file access operations in operating systems?

A

The common file access operations include opening, closing, reading, writing, and seeking within files.

46
Q

What happens when a file is closed in file systems?

A

When a file is closed, any remaining buffered data is flushed to the file, and the file can no longer be accessed by the process that closed it. The operating system may also automatically close any remaining open files owned by a process when the process terminates.

47
Q

Why is it common to read or write blocks of data in file systems?

A

Reading or writing blocks of data is common in file systems to reduce the number of system calls needed, as it is more efficient. Although library calls may provide higher-level functions, like reading one byte at a time, the underlying operations typically involve reading or writing blocks of data.

48
Q

What does seeking refer to in the context of file systems?

A

Seeking refers to the ability to perform random access within a file, similar to accessing elements in an array. It allows reading from or writing to specific positions in the file. The position index is managed using system calls and can be moved to different locations within the file.

49
Q

How is the end of a file indicated in file systems?

A

In file systems, the end of a file is often indicated by an End Of File (EOF) marker. Unix systems use an EOF status that can be checked using functions like feof() in C. Reading beyond the end of a file will return the value EOF, indicating the end of the file has been reached.

50
Q

What are the two ways of gaining access to a Unix file from an application?

A

In Unix, there are two main families of library calls for accessing files: stdio and sys. The stdio calls, such as fopen, fclose, fread, and fwrite, use a pointer to a concealed structure that contains the file descriptor. The sys calls, such as open, close, read, and write, directly use the numeric file descriptor. The stdio calls provide an extra layer of indirection and offer more formatting options compared to the sys calls.

51
Q

What are some typical common characteristics of filing systems?

A

Some typical common characteristics of filing systems include allocation of data in blocks, where a file occupies a set of whole blocks (usually around 1 KiB in size), and the use of some blocks for data and some for system organization. This allocation reflects the storage mechanism of disks and other media, reduces the number of items to address, but may not be a completely efficient use of space.

52
Q

Why is file block fragmentation necessary in filing systems?

A

File block fragmentation allows files to be placed non-contiguously on a disk, rather than occupying contiguous blocks like arrays in RAM. This is necessary to accommodate file extensions or modifications without requiring large blocks of contiguous free space. The fragmented blocks are indexed to ensure that each file specifies its own blocks in the correct order.

53
Q

What are two typical schemes for organizing files in filing systems?

A

Two typical schemes for organizing files in filing systems are the FAT (File Allocation Table) and I-nodes. These schemes provide methods for indexing and managing file blocks within the system.

54
Q

How does file fragmentation impact file system performance?

A

Although file systems can handle fragmented files, they assume that the underlying storage devices, such as magnetic disks, are not truly random access devices. Reading successive blocks is faster than accessing scattered ones. Fragmentation of files can slow down performance due to the increased seek time and reduced data locality.

55
Q

How can disk partitioning assist with file system fragmentation?

A

Disk partitioning involves dividing a disk into separate sections. By keeping utility binary files (which are not frequently modified) in a separate partition from user files that change frequently, the contents of the frequently modified partition can be reorganized without affecting the often-wanted files. This reduces fragmentation and prevents a slowdown in access time for frequently accessed files.

56
Q

How can arranging files near the disk’s index improve file access time?

A

Arranging files near the disk’s index reduces the access time because the index is typically located at a fixed position on the disk. Placing files closer to the index allows for faster access since the disk’s read/write head does not need to travel long distances to retrieve file data.

57
Q

What is an i-node in Unix systems?

A

An i-node is a structure used in Unix systems that contains file attributes and an array of pointers to blocks used by a specific file. Each i-node has a unique number and is stored in an array managed by the operating system. It is small in size and only needs to be kept in memory when the associated file is in use.

58
Q

How does the use of pointers in i-nodes allow for file expansion?

A

Not all blocks in an i-node need to contain data. Some blocks can be filled with pointers to other blocks, enabling significant file expansion. If needed, these “other blocks” can also be pointers themselves. By using conventions to determine the meaning of each item, the file size limit can be extended beyond the limited number of blocks directly pointed to by the i-node.

59
Q

How does the number of pointers in an i-node table entry affect file size limits?

A

The number of pointers in an i-node table entry determines the file size limits. Assuming a fixed block size and pointer size, the first 12 pointers directly correspond to file sizes up to a certain limit. Additional pointers enable single-indirect, double-indirect, and triple-indirect addressing, allowing for larger file sizes. Each level of indirection significantly expands the file size limit.

60
Q

How are filenames associated with i-node numbers in the filing system?

A

Filenames are associated with i-node numbers in directories. The i-node number serves as a unique identifier for the file, while filenames provide a user-friendly way to reference and identify the file. Multiple filenames can be linked to a single i-node, allowing for files to have multiple names.

61
Q

What is the simplest type of filing system?

A

The simplest filing system is a “flat” structure, where all files are stored in the same location. However, this approach becomes unmanageable for a significant number of files.

62
Q

What is the tree structure in a filing system?

A

The tree structure is a familiar filing system structure that allows for file categorization. Files can be organized into directories, and filenames can be duplicated in different directories. The actual filename includes the path to the file from the root of the filestore or relative to a known position.

63
Q

How can a file exist in multiple places without being copied?

A

Instead of copying the file, a link can be added. A link is an alias for a file and allows a file to appear in multiple locations within the filing system. This avoids data duplication.

64
Q

What is a symbolic link in Unix?

A

A symbolic link, also known as a “soft” link, is a special file that acts as a pointer to another file or directory. It does not have to link to anything real and can be used to create aliases or shortcuts.

65
Q

What is a hard link in Unix?

A

A hard link is a directory entry that directly links to the i-node of a file. When a file is created, an i-node is allocated, and a directory entry is made that includes the i-node number. Each hard link is a separate directory entry pointing to the same file.

66
Q

What happens when a file with multiple links is deleted?

A

Deleting a file that has multiple links will not actually delete the file’s data. The file remains intact until all links to its i-node are removed. Only when the last link is deleted, and no other links exist, will the file be truly deleted and the i-node become available for reuse.

67
Q

What is the difference between soft (symbolic) links and hard links in terms of i-nodes?

A

When a new hard link is created, it does not allocate a new i-node. The hard link directly points to the existing i-node of the file. On the other hand, each soft (symbolic) link has its own i-node, as it is treated as a separate file in its own right.

68
Q

What is a file descriptor?

A

A file descriptor is created when a file is opened and is associated with a specific file within a particular process. It is used for immediate file access and holds information such as access permissions, current position in the file, error status, and control flags.

69
Q

How does Unix handle opened files within a process?

A

Unix maintains a simple table of files for each process. One file can be opened multiple times simultaneously, with each opening having its own file descriptor. This allows for file sharing, where several processes can read the same file at the same time.