Finding a file, a process and its permissions
Lesson lab
Launch your own container and complete the task in your browser. Your link works with your account until the workspace closes, for up to 30 minutes.
Find the right copy of a file
Find the matching SHA-256 digest in a file manifest and enter the name of the exact copy.
The workshop has two documents called ticket.txt. One says “blue folder”, the other says “green folder”. A helper follows the advice “open ticket” and sometimes reads the wrong line. To give a precise instruction, you need the path. You will also check which program opens the file and which actions a particular user is allowed to perform.
A name within a folder
A folder can hold files and other folders. An absolute path starts at the root of a volume and identifies one location. A Windows path often starts with a drive letter and colon. A macOS or Linux path starts with a slash. Workshop/green/ticket.txt is relative to an agreed starting folder. Tell the reader where to start so that the instruction can be repeated. A file’s path and a line of text inside it are different things. One can change while the other stays the same.
Examine the tree. Indentation marks an item inside a folder. The blue and green folders are siblings. The extension suggests an expected file format. It does not verify what bytes a file contains.
Workshop/
blue/
ticket.txt = BLUE
green/
ticket.txt = GREEN
Searching only for ticket.txt can produce two valid results. Going directly into Workshop/green should lead to one ticket.txt containing GREEN. If a helper reports a missing file, ask where the search started. A file manager may hide the extension, and a recent document entry may refer to an earlier location. An empty listing in one folder says little about the rest of the drive.
Ownership and a permitted action
An account identifies the user on whose behalf a program operates. Reading an existing file, changing its contents and creating a new file in its parent folder are separate operations. The owner and the current user may happen to be the same person. Permission to read someone’s workshop notes does not necessarily grant permission to edit them. Removing or replacing a file can depend on permissions on the folder. For this lesson you only need to inspect your own file and read a sample permission card.
The card says “Mira: read and write; Jan: read; guests: no access”. Who can read the instructions? Who has permission to save an edit to the existing file? Can Jan create a separate document beside it? The last answer requires information about the folder. Leave it unknown rather than inventing a rule.
A window and a process
The operating system runs a program through one or more processes. A process has an identifier, often called a PID, and an account under which it runs. One editor may manage multiple windows. A browser may start multiple processes. Window and process counts need not match. A PID identifies the process at the time you look. Later the system may reuse that number.
Open Task Manager on Windows, Activity Monitor on macOS or System Monitor on GNOME. Look for your own editor by its displayed name. Record the name, observation time and PID if it is visible. Find two other familiar applications or use the sample “editor 41, browser 57, file manager 65”. Label the source of each row. Describe an action visible in the application window. You can leave unfamiliar services alone throughout this exercise.
Practice. Two tickets with one name
- In a suitable personal location, create an empty folder called Workshop. If the name is taken, choose a fresh name and use it in every step. Create blue and green inside it.
- Using a plain text editor, save ticket.txt containing BLUE in the blue folder. In TextEdit on macOS use Make Plain Text under Format. Check the complete filename. An unexpected ticket.txt.txt can explain a search that fails.
- Use the file manager’s Copy and Paste actions to place a copy inside green. Open it from that location, replace BLUE with GREEN and save it. Close both documents. Open each path again and record what it actually contains. If both say the same thing, check whether you edited the same path twice.
- Inspect one ticket’s properties. Look for Security on Windows, Sharing & Permissions in Get Info on macOS, or Permissions on Linux. Record one observation. When these fields are unavailable, use the supplied card and identify it as the source.
Hand it to another pupil
Write down two relative paths, the two observed lines, one process observation and a separate entry for permissions. Ask someone to find the green ticket without searching the whole drive. Now consider how to tell what the green copy contained before the edit. The blue copy shows the contents of a different file today. Your own before-and-after notes can establish which line you originally copied. The final tree alone cannot establish the exact order or time of the edits.
For the underlying concepts see Andrew Tanenbaum and Herbert Bos, Modern Operating Systems, fifth edition, chapters 2 and 4. Publisher’s contents
Where to put a check
Change the conditions and observe this training model. It runs in your browser and does not change your computer.
A team is preparing a release. Enable the independent checks and see what remains unknown.
Choose conditions above to see an explanation of the result.
Independent exercise
Two pupils saw the same filename and thought they had opened the same document.
Evidence
Snapshot 1: yellow/map.txt = N1; violet/map.txt = N1 Snapshot 2: yellow/map.txt = N2; violet/map.txt = N1
Assignment
Identify the path whose contents changed. State separately whether these snapshots identify the person who edited it.
Compare your reasoning
The observed contents of yellow/map.txt changed. The other copy kept N1. Neither a user identity nor an action log is present, so the editor cannot be identified.
Personal practice environment
Check an excerpt, find matching lines and compute the SHA-256 of the original text. Temporary data expires after 30 minutes or when you close the environment.
Sign in