CS-3310 - 04 I/O and Disks - Files and Directories

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

25 Terms

1
New cards

What are the three main requirements for long-term storage?

Store large data volumes, survive process termination, and support concurrent access.

2
New cards

What is a file?

A linear array of bytes stored persistently on disk.

3
New cards

What is an inode number?

A low-level numeric identifier for a file in the file system.

4
New cards

What is a directory?

A special file that maps file names to inode numbers.

5
New cards

What is the root directory?

The top of the directory tree (represented as / in Unix).

6
New cards

What is an absolute pathname?

A full path starting from the root directory.

7
New cards

What is a relative pathname?

A path relative to the current working directory.

8
New cards

Can files and directories share names?

Yes, as long as they are in different locations in the hierarchy.

9
New cards

What is the purpose of file extensions?

To indicate file type or format, though not enforced by the OS.

10
New cards

What system call creates or opens a file?

open()

11
New cards

What is returned by open()?

A file descriptor - a process-specific integer ID for the open file.

12
New cards

What does read() do?

Reads bytes from a file descriptor into memory.

13
New cards

What does write() do?

Writes bytes from memory to a file descriptor.

14
New cards

What does lseek() do?

Changes the current offset within an open file for random access.

15
New cards

Why is rename() atomic?

So file renames either fully succeed or fail without leaving partial states.

16
New cards

What is metadata?

Information about a file (size, owner, timestamps, permissions, etc.).

17
New cards

What is the stat() system call used for?

To retrieve file metadata via a stat struct.

18
New cards

What are the two special directory entries found in every directory?

"." for the current directory and ".." for the parent directory.

19
New cards

What does mkdir() do?

Creates a new directory with default entries "." and "..".

20
New cards

Why can't you directly edit directory files?

They are protected metadata managed by the OS.

21
New cards

What is a hard link?

Another directory entry pointing to the same inode.

22
New cards

What is a soft (symbolic) link?

A special file that stores a pathname reference to another file.

23
New cards

Why can't hard links reference directories or other partitions?

To prevent cycles and because inodes are unique only within a single filesystem.

24
New cards

What is a dangling symbolic link?

A soft link pointing to a deleted or nonexistent file.

25
New cards

What does unlink() do?

Removes a directory entry; file is deleted when no links remain.