# README
gosysutils
System utility functions (incl. some convenience wrappers for syscall
). Explicitly uses only the more modern x/sys/
and not the deprecated syscall
library.
For now, only linux/unix is supported (cross platform support will be added as needed).
# Functions
DirExists checks whether dirname exists and is a dir (it returns (somehwat peculiar?) true, error if exists but is not a dir).
DirSize returns the total size in bytes of the dir contents (recursively scanned) Adapted from https://ispycode.com/Blog/golang/2017-01/DU-estimate-file-space-usage work-alike with linux/unix du util.
FileExists checks whether filename exists and is a (regular) file (it returns (somehwat peculiar?) true, error if exists but is a dir).
No description provided by the author
we can use github.com/minio/minio/pkg/disk or github.com/shirou/gopsutil/disk, the latter may be useful for much more so we go with that.
No description provided by the author
LsDirs returns a string slice of all directory names found in the dir argument.
LsNames returns a string slice of all (file) names found in the dir argument, excluding "." and "..".
LsNames returns a string slice with the absolute path of all (file) names found in the dir argument, excluding "." and "..".
MountBind bind mounts src on target The calling process needs to run under root for this!.
MountBindAll bind mounts the source dirs in args[:nargs-2] in args[nargs-1], creating mount points based on the source dir names as needed.
ResolveSymlinks takes a list of paths and returns the resolved symlinks.
UmountAll unmounts all mountpoints under mount point root mpr "not mounted" errors are ignored, other errors are collected and returned.
No description provided by the author
# Constants
Version exposes the current package version.