No. 103·noun·also called path, absolute path, relative path

File path

The address of a file, written as the chain of folders that leads to it.

SPECIMEN · DIAGRAM · COMPARE

Absolute

  • Starts at the top: /Users/…
  • Works from anywhere
  • Long

Relative

  • Starts from here: src/…
  • Short
  • Depends on your current folder
Definition

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.

Say it like a builder

How to ask for it

Vague

“Change the file with the header in it.”

Precise

“In src/components/Header.tsx, change the logo link so it points to / instead of /home. Don't touch any other file.”

Why it works

A file path removes all ambiguity about which file to edit, and scoping the change to that path prevents collateral edits.

In the wild

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
Usage note

Often confused with