Documentation
¶
Overview ¶
Package pathutil provides path validation utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDirectoryWritable ¶
CheckDirectoryWritable checks if a directory exists and is writable. If the directory doesn't exist, it attempts to create it.
func CheckFileDirectoryWritable ¶
CheckFileDirectoryWritable checks if the directory containing a file path is writable.
func JoinAbsPath ¶
JoinAbsPath safely joins a base path with another path (which could be absolute or relative). If the second path is absolute and starts with the base path, it returns the second path as is. Otherwise, it joins them normally.
func NormalizeLibraryPath ¶
NormalizeLibraryPath builds a clean absolute library path by combining prefix segments. It handles stripping existing prefixes from the input path to prevent duplication.
func RemoveEmptyDirs ¶
func RemoveEmptyDirs(root, path string)
RemoveEmptyDirs recursively removes empty parent directories starting from 'path' up towards 'root' (exclusive). It stops if it encounters a non-empty directory or reaches the root.
Types ¶
This section is empty.