Documentation
¶
Overview ¶
Package fileutils contains utilities and helpers to manage and manipulate files.
Index ¶
- func CheckFileDigest(path string, digest string) bool
- func DiscUsageMegaBytes(path string) (string, error)
- func Exist(path string) bool
- func GetFileDigest(path string) string
- func ReadFile(path string) ([]byte, error)
- func UntarFile(path string, target string) error
- func WriteFile(path string, content []byte, perm uint32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFileDigest ¶
CheckFileDigest will compare input digest to the checksum of input file. Returns whether the input digest is equal to the input file's one.
func DiscUsageMegaBytes ¶
DiscUsageMegaBytes returns disk usage for input path in MB (rounded).
func GetFileDigest ¶
GetFileDigest will return the sha256sum of input file. Empty if error occurs.
func ReadFile ¶
ReadFile will return the content of input file or error. This is a linux-only implementation using syscalls for performance benefits.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.