COP4600 Module 7 Lecture 1

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/66

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.

67 Terms

1
New cards

File

Storage that is logically named (identified) and persistent.

2
New cards

What sequence makes up a file?

A byte sequence wherein each byte is 8 bits.

3
New cards

What sequence makes up records?

The sequence can be of any size.

4
New cards

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.

5
New cards

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.

6
New cards

Where is the 'magic number'?

It is located in the first 512 bytes of the file.

7
New cards

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.

8
New cards

File Attribute

An element that describes a characteristic of a file and provides information that system needs to handle the file.

9
New cards

What are examples of file attributes?

Title, record size, number of areas, and date of creation.

10
New cards

Where are permanent file attributes values stored in disk files?

In the disk file header.

11
New cards

Why don't we determine the type of a file by looking at its contents?

It can be more computationally costly and less precise.

12
New cards

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.

13
New cards

File Descriptor

An FCB loaded to memory.

14
New cards

What are some pieces of information contained in the FCB?

The ownership, size, permissions, dates, and more.

15
New cards

How is information about a file stored in UNIX?

In index nodes, also known as i-nodes.

16
New cards

What is a file descriptor used for?

To maintain the status of a data file that is being created or manipulated.

17
New cards

What determines how a file can be accessed?

The media type.

18
New cards

Sequential Access

Bytes must be accessed/navigated in linear order.

19
New cards

What types of media allow for sequential access?

Tapes and pipes.

20
New cards

Random Access

Data can be accessed in any (random) order. Data cursor can be moved via seek operation.

21
New cards

What types of media allow for random access?

HDD

SSD

Floppy Disks

22
New cards

Why did files begin to be organized by user?

Because as time went on, multiple users began sharing the same machine.

23
New cards

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.

24
New cards

How is a directory file distinguished?

It is usually marked as such via an attribute in its FCB.

25
New cards

Single, Shared Directory

There is one root directory and its children are files.

26
New cards

One Directory per User

There is one root directory, and its children are user directories. The children of the user directories are files.

27
New cards

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.

28
New cards

What are some common directory operations?

Create, read, delete, rename, open, close, link, and unlink.

29
New cards

Shared File

A file can be added to (shared by) more than one directory via a file system link.

30
New cards

How is a shared file implemented?

The shared files point to the same i-node, as they have the same i-node number.

31
New cards

Index Node or I-Node

Data structure that stores metadata about a file or directory, excluding its name and actual data content.

32
New cards

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.

33
New cards

File Type

Indicates whether the i-node represents a regular file, directory, symbolic link, device file, socket, or named pipe.

34
New cards

File Mode and Permissions

Permissions for the file (RWE), for the owner, group, and others.

35
New cards

File Owner and Group

The user ID (UID) and group ID (GID) of the file's owner and group.

36
New cards

File Size

The size of the file in bytes.

37
New cards

Timestamps

The three timestamps associated with the file: LAT, LMT, LCST.

38
New cards

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.

39
New cards

Where can hard links be used?

Within the same file system.

40
New cards

What happens when a hard link is removed?

It does not affect other links.

41
New cards

What happens when the name of the file associated with a hard link is changed?

Nothing happens as the link is not affected.

42
New cards

What happens when a hard link is used with a directory?

A hard link cannot be used with directories.

43
New cards

Symbolic or Soft Link

Contains the path for the original file and not the contents (pointers to file names).

44
New cards

What can a soft link link to?

A directory.

45
New cards

What can a soft link be linked across?

A soft link can be linked across different file systems.

46
New cards

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).

47
New cards

Link

A pointer to a file or directory.

48
New cards

What happens if the source of a hard link is moved or removed?

Nothing.

49
New cards

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.

50
New cards

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.

51
New cards

What is the size of a hard link?

The size of the original file.

52
New cards

What happens in the process of creating a file?

A hard link between the new file and the directory is created.

53
New cards

What happens in the process of deleting a file?

A file is unlinked.

54
New cards

What does the link count mean?

It represents how many links there are to the file.

55
New cards

What is the minimum link count of each existing file?

One.

56
New cards

Where is the hard link count stored?

In the i-node.

57
New cards

What happens to the hard link count on a successful link system call?

It increases by one.

58
New cards

What happens to the hard link count on an unsuccessful link system call?

It decreases by one.

59
New cards

What strategy is used to prevent deletion mid-operation?

The link count is incremented when a file is opened.

60
New cards

When is a file considered deleted?

When the link count reaches zero.

61
New cards

How can one find all the hard links to the same file?

Go through the entire filesystem comparing i-node numbers.

62
New cards

Why can linking or unlinking fail?

Due to permissions, existence, and other issues such as a lack of disk space.

63
New cards

Files system need to store information in a...

...persistent way (survives process termination)

64
New cards

File systems need to locate...

...free storage space

65
New cards

File systems need to allow more than one process to...

...access the information store concurrently

66
New cards

Tape backups are still widely used by large enterprises because of their...

longevity

67
New cards

Directory

Special file type that holds (part of) the FCB about other files