Documentation
¶
Overview ¶
Package fsutil provides filesystem utility functions
Index ¶
- Constants
- func EnsureDir(path string) error
- func IsDirectory(path string) bool
- func IsFile(path string) bool
- func NormalizePath(path string) string
- func PathExists(path string) bool
- func SafeCreateFile(path string, perm os.FileMode) (*os.File, error)
- func SafeMkdir(path string, perm os.FileMode) error
- func SanitizePath(basePath, userPath string) (string, error)
Constants ¶
View Source
const ( DirPerm = 0755 // rwxr-xr-x FilePerm = 0644 // rw-r--r-- )
Default permissions for directories and files
Variables ¶
This section is empty.
Functions ¶
func NormalizePath ¶
NormalizePath normalizes a path for the current OS
func SafeCreateFile ¶
SafeCreateFile creates a file if it doesn't exist, returns error if it does
func SanitizePath ¶
SanitizePath ensures the path is safe and doesn't escape the target directory
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.