Documentation
¶
Overview ¶
Package bilib provides common stuff for bisync and bisync_test
Package bilib provides common stuff for bisync and bisync_test Here it's got local file/directory helpers (nice to have in lib/file)
Package bilib provides common stuff for bisync and bisync_test
Index ¶
- Constants
- func BasePath(ctx context.Context, workDir string, fs1, fs2 fs.Fs) string
- func CanonicalPath(remote string) string
- func CaptureOutput(fun func()) []byte
- func CopyDir(src string, dst string) (err error)
- func CopyFile(src, dst string) (err error)
- func CopyFileIfExists(srcFile, dstFile string) error
- func FileExists(file string) bool
- func FsPath(f fs.Info) string
- func HasHexString(path string) bool
- func IsLocalPath(path string) bool
- func SaveList(list []string, path string) error
- func SessionName(fs1, fs2 fs.Fs) string
- func StripHexString(path string) string
- type AliasMap
- type Names
Constants ¶
const PermSecure = 0600
PermSecure is a Unix permission for a file accessible only by its owner
Variables ¶
This section is empty.
Functions ¶
func BasePath ¶ added in v1.66.0
BasePath joins the workDir with the SessionName, stripping {hexstring} suffix if necessary
func CanonicalPath ¶
CanonicalPath converts a remote to a suitable base file name
func CaptureOutput ¶
func CaptureOutput(fun func()) []byte
CaptureOutput runs a function capturing its output at log level INFO.
func CopyFileIfExists ¶
CopyFileIfExists is like CopyFile but does not fail if source does not exist
func FileExists ¶
FileExists returns true if the local file exists
func HasHexString ¶ added in v1.66.0
HasHexString returns true if path contains at least one canonical {hexstring} suffix
func IsLocalPath ¶
IsLocalPath returns true if its argument is a non-remote path. Empty string or a relative path will be considered local. Note: `c:dir` will be considered local on Windows but remote on Linux.
func SessionName ¶
SessionName makes a unique base name for the sync operation
func StripHexString ¶ added in v1.66.0
StripHexString strips the (first) canonical {hexstring} suffix
Types ¶
type AliasMap ¶ added in v1.66.0
AliasMap comprises a pair of names that are not equal but treated as equal for comparison purposes For example, when normalizing unicode and casing This helps reduce repeated normalization functions, which really slow things down