Documentation ¶
Overview ¶
The filesystem package exposes some useful function around files, for instance a simple function as `func Exists(src) bool` to verify a file existence easily.
It also exposes `CopyFile(src, dest) error` and `CopyFileWithPerm(src, dest, perm) error` which copy a given src file to dst with either specific permissions or not.
It also exposes `CopyDir(srcdir, destdir)` to copy a full directory at another place. The destination directory will be created if it doesn't already.
The package also exposes some constants around permissions.
Index ¶
Constants ¶
const ( // Rw represents a file permission of read/write for current user // and no access for user's group and other groups. Rw fs.FileMode = 0o600 // RwRR represents a file permission of read/write for current user // and read-only access for user's group and other groups. RwRR fs.FileMode = 0o644 // RwRwRw represents a file permission of read/write for current user // and read/write too for user's group and other groups. RwRwRw fs.FileMode = 0o666 // RwxRxRxRx represents a file permission of read/write/execute for current user // and read/execute for user's group and other groups. RwxRxRxRx fs.FileMode = 0o755 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FS ¶
FS represents a filesystem with required minimal functions like Open, ReadDir and ReadFile.
type FSOption ¶
type FSOption func(fsOpt *fsOpt)
FSOption represents a function taking an opt client to use filesysem package functions.