File path
The address of a file, written as the chain of folders that leads to it.
Absolute
- Starts at the top: /Users/…
- Works from anywhere
- Long
Relative
- Starts from here: src/…
- Short
- Depends on your current folder
What it is
A file path spells out where a file lives: src/pages/Home.tsx means "the file Home.tsx, inside pages, inside src." Folders are separated by / on Mac and Linux, \ on Windows.
An absolute path starts from the very top of the drive (/Users/sam/code/acme/src/Home.tsx) and works from anywhere. A relative path starts from the current folder (src/Home.tsx) and only works if you're in the right place.
Paths are the most precise way to point an agent at a file. "The home page file" is a guess; src/pages/Home.tsx is not.
How to ask for it
“Change the file with the header in it.”
“In src/components/Header.tsx, change the logo link so it points to / instead of /home. Don't touch any other file.”
A file path removes all ambiguity about which file to edit, and scoping the change to that path prevents collateral edits.
You've seen this in
- FFile names at the top of a code editor tab
- EError messages like "Cannot find module ./utils"
- FBreadcrumbs in Finder or File Explorer