Documentation
¶
Overview ¶
Package pathutil provides path resolution utilities with no dependencies on other Zaparoo packages. This allows both config and helpers to use these functions without circular imports.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalMediaPath ¶ added in v2.15.0
CanonicalMediaPath normalizes a persisted media path to media.db's storage format. Filesystem paths are cleaned and stored with forward slashes; URI paths are kept unchanged.
func ExeDir ¶
func ExeDir() string
ExeDir returns the directory containing the currently running executable. Returns an empty string if the executable path cannot be determined.
func ResolveRelativePath ¶
ResolveRelativePath resolves a path relative to ExeDir if it is not absolute. Absolute and empty paths are returned unchanged.
func WriteFileAtomic ¶ added in v2.18.0
WriteFileAtomic writes a sibling temporary file, syncs and closes it, then replaces the destination. Failures before replacement preserve the old file. This does not sync the parent directory or promise power-loss durability.
Types ¶
This section is empty.