Documentation
¶
Index ¶
- Constants
- Variables
- func AssertDir(path string) (err error)
- func Close(f *os.File) error
- func CloseReadOnly(f *os.File)
- func CombinedOutput(c *exec.Cmd) ([]byte, error)
- func Create(s string) (f *os.File, err error)
- func CreateExclusiveReadOnly(path string) (file *os.File, err error)
- func CreateExclusiveWriteOnly(p string) (f *os.File, err error)
- func DirEntries(dirPath string) (dirEntries collections_slice.Slice[os.DirEntry], err error)
- func DirNameWriterIgnoringHidden(seq interfaces.SeqError[string]) interfaces.SeqError[string]
- func DirNames(dirPath string) (slice collections_slice.Slice[string], err error)
- func DirNames2(p string) interfaces.SeqError[os.DirEntry]
- func DirNamesLevel2(dirPath string) interfaces.SeqError[string]
- func DirectoriesRelativeTo(p string) []string
- func Exists(path string) bool
- func IsErrNotDirectory(err error) bool
- func MakeDirIfNecessary(base string, joinFunc func(string, ...string) string, pathComponents ...string) (path string, err error)
- func MakeDirIfNecessaryForStringerWithHeadAndTail(stringer interfaces.StringerWithHeadAndTail, pathComponents ...string) (path string, err error)
- func MakeDirNameWriterIgnoringHidden(wf func(string) error) func(string) error
- func MakeHashBucketPath(hashBytes []byte, buckets []int, pathComponents ...string) string
- func MakeHashBucketPathJoinFunc(buckets []int) func(string, ...string) string
- func Open(s string) (f *os.File, err error)
- func OpenCreate(s string) (f *os.File, err error)
- func OpenCreateWriteOnlyTruncate(s string) (f *os.File, err error)
- func OpenExclusive(s string) (f *os.File, err error)
- func OpenExclusiveReadOnly(s string) (f *os.File, err error)
- func OpenExclusiveWriteOnly(s string) (f *os.File, err error)
- func OpenExclusiveWriteOnlyAppend(s string) (f *os.File, err error)
- func OpenExclusiveWriteOnlyTruncate(s string) (f *os.File, err error)
- func OpenFile(name string, flag int, perm os.FileMode) (f *os.File, err error)
- func OpenFiles(p ...string) (err error)
- func OpenReadOnly(s string) (f *os.File, err error)
- func OpenReadWrite(s string) (f *os.File, err error)
- func PathElements(p string) []string
- func PathFromHeadAndTail(stringer interfaces.StringerWithHeadAndTail, pathComponents ...string) string
- func ReadAllString(s ...string) (o string, err error)
- func ReadDir(ps ...string) (dirEntries []os.DirEntry, err error)
- func ReadDirNamesLevel2(wf func(string) error, p string) (err error)
- func ReadDirNamesTo(wf func(string) error, p string) (err error)
- func Readlink(path string) (string, error)
- func Rename(src, dst string) (err error)
- func SetAllowUserChanges(paths ...string) (err error)
- func SetAllowUserChangesRecursive(paths ...string) (err error)
- func SetDisallowUserChanges(paths ...string) (err error)
- func TryOrMakeDirIfNecessary(path string, apply func(string) (*os.File, error)) (file *os.File, err error)
- func TryOrTimeout(path string, timeout time.Duration, apply func(string) (*os.File, error), ...) (*os.File, error)
- func WalkDir(base string) interfaces.SeqError[WalkDirEntry]
- func WalkDirIgnoreFuncHidden(dirEntry WalkDirEntry) bool
- type ErrNotDirectory
- type FileType
- type TemporaryFS
- type WalkDirEntry
- type WalkDirEntryIgnoreFunc
Constants ¶
Variables ¶
View Source
var (
ErrEmptyFileList = newPkgError("empty file list")
)
Functions ¶
func CloseReadOnly ¶
CloseReadOnly closes a read-only file descriptor, intentionally discarding the error. close(2) errors on read-only fds are about flushing writes (EIO, ENOSPC, EDQUOT) which cannot occur when no writes were performed. The fd is always freed on Linux and macOS regardless of the error. Go's own os.ReadFile uses this same pattern.
func DirEntries ¶
func DirNameWriterIgnoringHidden ¶
func DirNameWriterIgnoringHidden( seq interfaces.SeqError[string], ) interfaces.SeqError[string]
func DirNamesLevel2 ¶
func DirNamesLevel2( dirPath string, ) interfaces.SeqError[string]
func MakeDirIfNecessary ¶
func MakeDirIfNecessaryForStringerWithHeadAndTail ¶
func MakeDirIfNecessaryForStringerWithHeadAndTail( stringer interfaces.StringerWithHeadAndTail, pathComponents ...string, ) (path string, err error)
func MakeDirNameWriterIgnoringHidden ¶
func MakeHashBucketPath ¶
func MakeHashBucketPathJoinFunc ¶
func OpenCreateWriteOnlyTruncate ¶
func OpenExclusiveWriteOnlyAppend ¶
func OpenExclusiveWriteOnlyTruncate ¶
func PathFromHeadAndTail ¶
func PathFromHeadAndTail( stringer interfaces.StringerWithHeadAndTail, pathComponents ...string, ) string
func TryOrMakeDirIfNecessary ¶
func TryOrTimeout ¶
func WalkDir ¶
func WalkDir( base string, ) interfaces.SeqError[WalkDirEntry]
func WalkDirIgnoreFuncHidden ¶
func WalkDirIgnoreFuncHidden(dirEntry WalkDirEntry) bool
Types ¶
type ErrNotDirectory ¶
type ErrNotDirectory string
func (ErrNotDirectory) Error ¶
func (err ErrNotDirectory) Error() string
func (ErrNotDirectory) GetErrorType ¶
func (err ErrNotDirectory) GetErrorType() pkgErrDisamb
func (ErrNotDirectory) Is ¶
func (err ErrNotDirectory) Is(target error) bool
type TemporaryFS ¶
type TemporaryFS struct {
BasePath string
}
func (TemporaryFS) DirTemp ¶
func (fs TemporaryFS) DirTemp() (d string, err error)
func (TemporaryFS) DirTempWithTemplate ¶
func (fs TemporaryFS) DirTempWithTemplate( template string, ) (dir string, err error)
func (TemporaryFS) FileTemp ¶
func (fs TemporaryFS) FileTemp() (file *os.File, err error)
type WalkDirEntryIgnoreFunc ¶
type WalkDirEntryIgnoreFunc func(WalkDirEntry) bool
Source Files
¶
- binary.go
- chflags.go
- chflags_linux.go
- dirnames.go
- dirnames_iter.go
- errors.go
- exec.go
- exists.go
- filetype_string.go
- hash_bucket.go
- main.go
- rename.go
- temp.go
- util.go
Click to show internal directories.
Click to hide internal directories.