2024-11-12 06:32:04 -05:00
|
|
|
package paths
|
|
|
|
|
|
|
|
import (
|
2024-11-12 06:50:44 -05:00
|
|
|
"io/fs"
|
2024-11-12 06:32:04 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
// Mostly just for reference.
|
|
|
|
const (
|
|
|
|
// ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice | ModeCharDevice | ModeIrregular
|
2024-11-12 06:50:44 -05:00
|
|
|
modeDir pathMode = pathMode(fs.ModeDir)
|
|
|
|
modeSymlink pathMode = pathMode(fs.ModeSymlink)
|
|
|
|
modePipe pathMode = pathMode(fs.ModeNamedPipe)
|
|
|
|
modeSocket pathMode = pathMode(fs.ModeSocket)
|
|
|
|
modeDev pathMode = pathMode(fs.ModeDevice)
|
|
|
|
modeCharDev pathMode = pathMode(fs.ModeCharDevice)
|
|
|
|
modeIrregular pathMode = pathMode(fs.ModeIrregular)
|
|
|
|
modeAnyExceptRegular pathMode = modeDir | modeSymlink | modePipe | modeSocket | modeDev | modeCharDev | modeIrregular
|
2024-11-12 06:32:04 -05:00
|
|
|
)
|
|
|
|
|
2024-11-18 17:36:14 -05:00
|
|
|
// Miss reasons
|
|
|
|
const (
|
|
|
|
MissNoMiss missReason = ""
|
|
|
|
MissNoMeta missReason = "Could not determine metadata"
|
|
|
|
MissBadBase missReason = "Base name does not match BasePtrn"
|
|
|
|
MissBadPath missReason = "Path does not match PathPtrn"
|
|
|
|
MissBadTime missReason = "Time(s) does not/do not match Age"
|
|
|
|
MissFile missReason = "Object is a file and NoFiles is set"
|
|
|
|
MissType missReason = "Object does not match TargetType"
|
|
|
|
)
|
|
|
|
|
2024-11-12 06:32:04 -05:00
|
|
|
// Times
|
|
|
|
const TimeAny pathTimeType = 0
|
|
|
|
const (
|
|
|
|
// TimeAccessed == atime
|
|
|
|
TimeAccessed pathTimeType = 1 << iota
|
|
|
|
// TimeCreated == "birth" time (*NOT* ctime! See TimeChanged)
|
|
|
|
TimeCreated
|
|
|
|
// TimeChanged == ctime
|
|
|
|
TimeChanged
|
|
|
|
// TimeModified == mtime
|
|
|
|
TimeModified
|
|
|
|
)
|