Documentation
¶
Index ¶
- Constants
- func Backup(path string) error
- func Bytes(s uint64) string
- func BytesShort(s uint64) string
- func CheckSumCompare(t string, w io.Writer, flagSet *flag.FlagSet, suppress bool) error
- func CheckSumMain(t string, w io.Writer, flagSet *flag.FlagSet, suppress bool) error
- func Checksum(t string, fp io.Reader) (string, error)
- func CompareSlice(s1, s2 []byte) (int, bool)
- func ConvertFileModeStr(mode string) (os.FileMode, error)
- func FileExists(path string) bool
- func FileNotExists(path string) bool
- func IBytes(s uint64) string
- func IntContains(target []int, src int) bool
- func IsDir(name string) (bool, error)
- func IsHidden(name string) bool
- func IsMalformedFileMode(mode os.FileMode) bool
- func IsNamedPipe(info os.FileInfo) bool
- func IsNumber(s string) (int, bool)
- func IsSymlink(info os.FileInfo) bool
- func OpenTwoFiles(files []string) (sf *os.File, df *os.File, err error)
- func ParseBytes(s string) (uint64, error)
- func ReadWholeLine(b *bufio.Reader) (line string, err error)
- func StringsContains(target []string, src string) bool
- func StringsHas(target []string, src string) bool
- func UniqSortInt(src []int) []int
- func Walk(path string, info os.FileInfo, depth int, parentIgnores IgnoreMatchers, ...) error
- func WrapString(src string, lim int, delim string) string
- type IgnoreMatcher
- type IgnoreMatchers
Constants ¶
View Source
const ( Byte = 1 << (iota * 10) KiByte MiByte GiByte TiByte PiByte EiByte )
IEC Sizes. kibis of bits
View Source
const ( IByte = 1 KByte = IByte * 1000 MByte = KByte * 1000 GByte = MByte * 1000 TByte = GByte * 1000 PByte = TByte * 1000 EByte = PByte * 1000 )
SI Sizes.
View Source
const BackupSuffix = "~"
Variables ¶
This section is empty.
Functions ¶
func Bytes ¶
Bytes produces a human readable representation of an SI size.
See also: ParseBytes.
Bytes(82854982) -> 83 MB
func BytesShort ¶
func CheckSumCompare ¶
func CheckSumMain ¶
func CompareSlice ¶
func FileExists ¶
func FileNotExists ¶
func IBytes ¶
IBytes produces a human readable representation of an IEC size.
See also: ParseBytes.
IBytes(82854982) -> 79 MiB
func IntContains ¶
IntContains checks the src in any int of the target int slice.
func IsMalformedFileMode ¶
func IsNamedPipe ¶
func ParseBytes ¶
ParseBytes parses a string representation of bytes into the number of bytes it represents.
See Also: Bytes, IBytes.
ParseBytes("42 MB") -> 42000000, nil ParseBytes("42 mib") -> 44040192, nil
func StringsContains ¶
StringsContains checks the src in any string of the target string slice
func StringsHas ¶
StringsHas checks the target string slice contains src or not
func UniqSortInt ¶
Types ¶
type IgnoreMatcher ¶
type IgnoreMatchers ¶
type IgnoreMatchers []IgnoreMatcher
Click to show internal directories.
Click to hide internal directories.