File paths: an address for a file

Concepts explained

A file path tells a program where to find a file. Folders act like boxes inside other boxes. A path names the route through those boxes.

Imagine a project with a folder called pictures, containing turtle.png. Its project-relative path is pictures/turtle.png.

Relative and absolute

A relative path starts from an agreed place, such as the current folder or project root. An absolute path starts from a filesystem root; on Windows it may include a drive such as D:.

The starting place matters. A Markdown link is relative to the article containing it. A Pliro asset path is interpreted using the project’s asset rules. Do not assume every tool uses the same starting folder.

.. often means “the parent folder” in filesystem paths. It is not a way to escape a Pliro project’s asset boundary: project assets use checked project paths.

A path is still text

Writing a filename in quotes does not open it by itself. A function must actually use that text as a path. A saved-data key such as "bestScore" is a lookup label, not a filename you choose on disk.

When sharing a project, include its needed files and use the supported project paths. A path into your own Downloads folder will probably not exist on a friend’s computer.

Try drawing a folder tree on paper and tracing the route to one picture. Check spelling and letter case: some systems distinguish Turtle.png from turtle.png.

File extensions · Assets