Documentation
¶
Overview ¶
Package file provides cross-platform file system utilities for path resolution, existence checks, directory creation, and writability testing.
Designed for use in Go applications and test suites that need to locate project root directories, verify file paths, and manage directories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCmdRootPath ¶
func GetCmdRootPath() string
GetCmdRootPath returns the current working directory, stripping any /etc/ suffix.
func GetModRootPath ¶
GetModRootPath walks up from the current working directory looking for a project root (a directory containing "etc" or "data" subdirectories). Returns the path and an error if no root marker is found.
func GetRootPath ¶
func GetRootPath() string
GetRootPath returns the cached project root path, panicking if it cannot be found.
func IsWritable ¶
IsWritable tests whether the given directory path is writable by creating and immediately removing a temporary file.
func PreCreateDirectory ¶
PreCreateDirectory ensures the directory at path exists, creating it (and any parents) if necessary.
Types ¶
This section is empty.