File Systems Flashcards

(34 cards)

1
Q

⭐️ Give the definition:
Array of persistent bytes that can be created/read/written/deleted

A

File

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

⭐️ Give the definition:
Refers to collection of files. Describes how files are mapped onto physical devices. Also refers to parts of the OS that manages these files

A

File System (FS)

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

⭐️ Give the definition:
Low-level names for files, index node

A

Inode

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

⭐️ What do we call the type of files that are human readable?

A

Path

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

⭐️ What do we call the file type that describes a files runtime state?

A

File descriptor

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

⭐️ What are inodes unique within?

A

A FS

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

⭐️ How many inode numbers does a file have?

A

1

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

What does this command do?
$ stat -x <file></file>

A

Shows inodes

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

Give the definition:
Reads for getting final inode

A

Traversal

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

Give the definition:
Unique ID for a file

A

Inode

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

How does the FS interact with inode numbers?

A

By using path-to-inode mappings

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

Where are path-to-inode mappings stored?

A

In a directory

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

Give the definition:
Placing directories within other directories

A

Directory tree/hierarchy

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

Directories and files can have the same name as long as they’re in…

A

Different locations of the file system tree

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

Give the definition:
Runtime name to read & write files

A

File descriptor

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

What table contains pointers to open file descriptors?

A

File descriptor table

17
Q

Integers used for file I/O are indexes into what table?

A

File descriptor table

18
Q

Give the definition:
An API used for manipulation of files

19
Q

⭐️ What command in the file API is this?
Returns a file descriptor

20
Q

⭐️ What command in the file API is this?
Allows a process to create a new file descriptor that refers to the same underlying open file as an existing descriptor

21
Q

⭐️ What commands in the file API is this?
Calls return the processed bytes

A

read() & write()

22
Q

⭐️ What command in the file API is this?
Deletes a descriptor. Returns 0 for success & -1 for failure.

23
Q

⭐️ What command in the file API is this?
read & write non-sequentially

24
Q

⭐️ What is whence in lseek() set to if offset is set to offset bytes?

25
⭐️ What is whence in lseek() set to if offset is set to its current location + offset bytes?
SEEK_CUR
26
⭐️ What is whence in lseek() set to if offset is set to the size of the file & offset bytes?
SEEK_END
27
⭐️ Give the definition: Writing immediately. Forces buffers to flush to disk, tells disk to flush its write cache.
fsync()
28
⭐️ Does a write buffer improve or lower performance?
Improve
29
Which function for deleting a file is this: Deletes paths when called
unlink()
30
What function for deleting a file is this: function descriptors are deleted
close() / process quitting
31
What function for renaming files is this? - Deletes an old link to a file - Creates a new link to a file
rename(char* old, char* new)
32
Does the rename() function both change the name of a file, and move data?
No, it only changes the name of the file
33
What sort of call is the rename() function implemented as?
Atomic - only old/new contents can be seen if crash
34
⭐️ What are the three key factors that contribute to the latency of reading a file on a computer with a HDD?
Seek, rotation & transfer