file systems files directories Flashcards

https://www.francogarcia.com/en/blog/file-systems-files-folders-and-paths/

1
Q

What is an absolute path?

A

A unique path that starts from the root of a file system and ends at the chosen destination (file or directory).

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

How do absolute paths differ between Windows and Unix-based systems?

A
  • Windows: Starts with a drive letter (e.g., C:). Uses backslashes ().
  • Unix: Starts with a forward slash (/). Uses forward slashes (/).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the root of a file system in Windows?

A

The root is a drive letter followed by a colon and backslash, such as C:.

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

What is the root of a file system in Unix-based systems?

A

It is represented by a single forward slash (/).

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

How does Windows handle case sensitivity in file paths?

A

Windows is not case-sensitive. For example, abc.txt and ABC.TXT refer to the same file.

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

How does Unix handle case sensitivity in file paths?

A

Unix-based systems are case-sensitive. For example, abc.txt and ABC.TXT are different files.

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

Why do Windows paths use backslashes?

A

Backslashes are inherited from DOS, where forward slashes were used for command-line parameters.

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

What is a tilde (~) in Unix-based systems?

A

A shorthand for the current user’s home directory.

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

Why is it recommended to avoid spaces and special characters in file names?

A

To minimise problems with command-line tools and programming libraries that assume simpler naming conventions.

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

What is a relative path?

A

A path that starts from an arbitrary origin instead of the root of the file system.

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

What does the dot (.) represent in relative paths?

A

The current directory.

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

What do two dots (..) represent in relative paths?

A

The parent directory of the current directory.

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

How do relative paths differ from absolute paths?

A

Relative paths depend on the current working directory, while absolute paths do not.

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

What is the working directory?

A

The directory currently assumed as the origin for relative paths.

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

How can you retrieve the working directory on Unix?

A

By using the $PWD environment variable.

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

How can you retrieve the working directory on Windows?

A

By using the ‘cd’ command.

17
Q

What is encoding?

A

The process of converting a value to a code, such as text to binary.

18
Q

What is decoding?

A

The process of converting a code back into its original value.

19
Q

What is transcoding?

A

Encoding followed by decoding.

20
Q

How is the character ‘a’ represented in binary using UTF-8?

A

As 1100001 (binary) or 97 (decimal).

21
Q

What does the ord() function in Python do?

A

Returns the Unicode code point of a character.

22
Q

What are the three main ways a computer determines which program to use to open a file?

A
  1. A person manually chooses the program.
  2. By recognising the file’s extension.
  3. By reading metadata stored in the file’s header.
23
Q

What is a file extension?

A

A sequence of characters appended to a file’s name, usually after a dot, indicating the file’s format.

24
Q

Are file extensions mandatory?

A

No, a file can exist without an extension, but it still retains its type based on its data format.

25
Q

How do extensions help an operating system?

A

Extensions act as a heuristic, providing a tip about the file type and helping the operating system select an appropriate program to open it.

26
Q

What is metadata in the context of files?

A

Information stored in the file’s header, often at the beginning, describing the file’s contents and format.

27
Q

What does a computer do when it cannot determine how to open a file?

A

It may attempt to guess the file’s format by analysing its contents or ask the user to select a program.