package fileutil
import "github.com/coreos/rkt/pkg/fileutil"
Index ¶
- func CopyRegularFile(src, dest string) (err error)
- func CopySymlink(src, dest string) error
- func CopyTree(src, dest string, uidRange *user.UidRange) error
- func DirSize(path string) (int64, error)
- func EvalSymlinksAlways(path string) (string, error)
- func GetDeviceInfo(path string) (kind rune, major uint64, minor uint64, err error)
- func IsDeviceNode(path string) bool
- func IsExecutable(path string) bool
- func LUtimesNano(path string, ts []syscall.Timespec) error
- func Lgetxattr(path string, attr string) ([]byte, error)
- func Lsetxattr(path string, attr string, data []byte, flags int) error
- func TimeToTimespec(time time.Time) (ts syscall.Timespec)
Functions ¶
func CopyRegularFile ¶
func CopySymlink ¶
func CopyTree ¶
func DirSize ¶
DirSize takes a path and returns its size in bytes
func EvalSymlinksAlways ¶
EvalSymlinksAlways behaves like filepath.EvalSymlinks but does not require that all path components must exist.
While filepath.EvalSymlink behaves like `readlink -e` this function behaves like `readlink -m`.
Unlike `readlink` EvalSymlinksAlways might return a relative path.
func GetDeviceInfo ¶
GetDeviceInfo returns the type, major, and minor numbers of a device. Kind is 'b' or 'c' for block and character devices, respectively. This does not follow symlinks.
func IsDeviceNode ¶
IsDeviceNode checks if the given path points to a block or char device. It doesn't follow symlinks.
func IsExecutable ¶
IsExecutable checks if the given path points to an executable file by checking the executable bit. Inspired by os.exec.LookPath()
func LUtimesNano ¶
TODO(sgotti) waiting for a utimensat functions accepting flags and a LUtimesNano using it in https://github.com/golang/sys/
func Lgetxattr ¶
Returns a nil slice and nil error if the xattr is not set
func Lsetxattr ¶
func TimeToTimespec ¶
TODO(sgotti) use UTIMES_OMIT on linux if Time.IsZero ?
Source Files ¶
fileutil.go fileutil_linux.go symlink.go
- Version
- v1.30.0 (latest)
- Published
- Apr 13, 2018
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 5 days ago –
Tools for package owners.