Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

THE UNIX FILESYSTEM Problem 2 (8 points): Answer the following questions about a

ID: 3590378 • Letter: T

Question

THE UNIX FILESYSTEM Problem 2 (8 points): Answer the following questions about absolute and relative filenames: of a file to some given location in the a) A relative filename is the relative filesystem. b) An absolute filename is the location of a file. c) Assume you have a directory with a bunch of files inside. You have writtena computer program (also inside of that directory) to read and write to those files. If you are going to be moving the directory to different locations on your computer, and you do not want to have to keep modifying your computer program to use those same files every time you move the directory, should you use absolute or relative filenames? d) Would pictures/trip_to_nebraska/ be considered absolute or relative? e) Would /important_ files/accounts/myFile.txt be considered absolute or relative? f) Would ../files/test.rb be considered absolute or relative?

Explanation / Answer

a) A relative filename is the relative path of a file to some given location in the filesystem.

b) An Absolute filename is the actual location of the file.

c) Use relative filenames, As we are moving the folder from one location to another location if we write absolute path it will need to be changed everytime we change the location of the folder.

So instead we use relative filenames so that relative path of the files to be read will remain same to program and need not chnage.

d) This is relative path to the present working directory. as absolute filenames starts with /

e) This is absolute filename or path as it starts with / , also this means that the path is mentioned from the root.

f) This also refers to relative filenames as .. indicates the parent directory to present working directory and them follow that path in the parent of pwd(present working directory)