Documentation
¶
Index ¶
- Variables
- func HasDotDots(paths ...string) error
- func InstallTOML(path string, cfg any) error
- func IsExp(expiry time.Time, path string) (bool, *unix.Stat_t)
- func IsRel(path string, bases ...string) bool
- func MntPoint(path string) (string, error)
- func Mv(srcPath string, dstPath string, attr *Attr) error
- func QuarantinePath(quarantineDir string, path string) string
- func ReadTOML(path string, cfg any) error
- func Walk(path string) ([]string, error)
- func WalkByExt(path string, exts ...string) ([]string, error)
- func WriteTOML(path string, cfg any) error
- type Attr
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFileOpen means file open error. ErrFileOpen = errors.New("fsys: file open error") // ErrFileCreate means file create error. ErrFileCreate = errors.New("fsys: file create error") // ErrFileCopy means file copy error. ErrFileCopy = errors.New("fsys: file copy error") // ErrFileDel means file del error. ErrFileDel = errors.New("fsys: file del error") )
FILES
View Source
var ( // ErrWalk means walk error. ErrWalk = errors.New("fsys: walk error") // ErrDirCreate means dir create error. ErrDirCreate = errors.New("fsys: dir create error") // ErrDirMv means dir move attempt. ErrDirMv = errors.New("fsys: only files permitted for move") )
DIR
View Source
var ( // ErrStat means stat error. ErrStat = errors.New("fsys: stat error") // ErrChmod means chmod error. ErrChmod = errors.New("fsys: chmod error") // ErrChown means chown error. ErrChown = errors.New("fsys: chown error") )
MODE
View Source
var ( // ErrPathInvalid means invalid path format. ErrPathInvalid = errors.New("fsys: invalid path format") // ErrPathRoot means root path not permitted. ErrPathRoot = errors.New("fsys: root path not permitted") // ErrPathNotAbs means path not absolute. ErrPathNotAbs = errors.New("fsys: path not absolute") )
VALIDATION
View Source
var ( // ErrTOMLRead means toml read error. ErrTOMLRead = errors.New("fsys: toml read error") // ErrTOMLWrite means toml write error. ErrTOMLWrite = errors.New("fsys: toml write error") )
TOML
Functions ¶
func HasDotDots ¶
HasDotDots validates paths against dot dots, relative, root or current dir.
func InstallTOML ¶
InstallTOML installs a toml file by first checking if a matching .toml file exists and if not, will write the file but with file extension .disabled.
func IsExp ¶ added in v1.2.2
IsExp verifies is a file has exceeded max mtime. Timestomp protection with ctime.
func QuarantinePath ¶
QuarantinePath returns a path's quarantine path from given parent dir and detection path.
Types ¶
Click to show internal directories.
Click to hide internal directories.