Documentation ¶
Index ¶
- func ErrDie[T any](a T, err error) T
- func ErrIgnore[T any](a T, err error) T
- type Pathname
- func (o Pathname) AbsolutePath() Pathname
- func (o Pathname) Append(path string) Pathname
- func (o Pathname) AppendRandom() Pathname
- func (o Pathname) Basename() string
- func (o Pathname) Chdir() error
- func (o Pathname) ChdirWithin(block func(path Pathname)) error
- func (o Pathname) Children() ([]Pathname, error)
- func (o Pathname) ChildrenNames() []string
- func (o Pathname) Chmod(perm uint32) error
- func (o Pathname) Chown(uid int) error
- func (o Pathname) Cleaned() Pathname
- func (o Pathname) CopyDirTo(toPath Pathname) error
- func (o Pathname) CopyFileTo(toPath Pathname) error
- func (o Pathname) CopyTo(toPath Pathname) error
- func (o Pathname) Exist() bool
- func (o Pathname) Extension() string
- func (o Pathname) Glob(pattern string) []Pathname
- func (o Pathname) IsAbsolute() bool
- func (o Pathname) IsDirectory() bool
- func (o Pathname) IsFile() bool
- func (o Pathname) IsRegularFile() bool
- func (o Pathname) IsSymlink() bool
- func (o Pathname) Mkpath() error
- func (o Pathname) Mkpath2(perm uint32) error
- func (o Pathname) MoveTo(path Pathname) error
- func (o Pathname) Parent() Pathname
- func (o Pathname) Perm() uint32
- func (o Pathname) Read() (string, error)
- func (o Pathname) Rmtree() error
- func (o Pathname) String() string
- func (o Pathname) SymlinkTo(toPath Pathname) error
- func (o Pathname) Walk(block func(path Pathname, entry fs.DirEntry, err error) error) error
- func (o Pathname) Write(text string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Pathname ¶
type Pathname struct {
// contains filtered or unexported fields
}
Pathname is convenient tool to manipulate filepath inspired by Ruby's Pathname
func (Pathname) AbsolutePath ¶
AbsolutePath returns an absolute representation of path. If the path is not absolute it will be joined with the current
func (Pathname) AppendRandom ¶
func (Pathname) ChdirWithin ¶
func (Pathname) ChildrenNames ¶
func (Pathname) CopyDirTo ¶
CopyDirTo Just demo wrapper of the unix cp command with '-r' the toPath must not exist (while the toPath's parent must exist)
func (Pathname) CopyFileTo ¶
func (Pathname) IsAbsolute ¶
func (Pathname) IsDirectory ¶
func (Pathname) IsRegularFile ¶
Click to show internal directories.
Click to hide internal directories.