File Systems Flashcards

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

Give the definition:
Human readable name for a file

A

Path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
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
13
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
14
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
15
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
16
Q

Give the definition:
Runtime name to read & write files

A

File descriptor

17
Q

What table contains pointers to open file descriptors?

A

File descriptor table

18
Q

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

A

File descriptor table

19
Q

Give the definition:
An API used for manipulation of files

20
Q

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

21
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

22
Q

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

A

read() & write()

23
Q

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

24
Q

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

25
Q

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

26
Q

What is whence in lseek() set to if offset is set to its current location + offset bytes?

27
Q

What is whence in lseek() set to if offset is set to the size of the file & offset bytes?

28
Q

Give the definition:
Writing immediately. Forces buffers to flush to disk, tells disk to flush its write cache.

29
Q

Does a write buffer improve or lower performance?

30
Q

Which function for deleting a file is this:
Deletes paths when called

31
Q

What function for deleting a file is this:
function descriptors are deleted

A

close() / process quitting

32
Q

What function for renaming files is this?
- Deletes an old link to a file
- Creates a new link to a file

A

rename(char* old, char* new)

33
Q

Does the rename() function both change the name of a file, and move data?

A

No, it only changes the name of the file

34
Q

What sort of call is the rename() function implemented as?

A

Atomic - only old/new contents can be seen if crash