Skip to main content

Module path_util

Module path_util 

Source
Expand description

Path utilities used by storage layer.

Stored relative paths are normalized to forward slashes regardless of the host OS. This lets the same drive be opened on Linux, Windows, and macOS without the reindexer flagging every photo as “new” because the stored path string differs by separator.

Functions§

relative_path_for_storage
Convert a relative path into the canonical string form used in the photos.file_path and related columns: forward slashes only.
safe_existing_path_under_root
Resolve an existing DB-stored path and prove it still lives under the trusted root after following symlinks.
safe_join_relative
Join a DB-stored relative path to a trusted root.