mirror of
https://github.com/rclone/rclone.git
synced 2025-12-21 02:33:49 +00:00
Factor new vfs module out of cmd/mountlib
This is an OS style file system abstraction with directory caching used in mount, cmount, serve webdav and serve http.
This commit is contained in:
19
vfs/vfs_unix.go
Normal file
19
vfs/vfs_unix.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// +build linux darwin freebsd
|
||||
|
||||
package vfs
|
||||
|
||||
import (
|
||||
"github.com/spf13/pflag"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// add any extra platform specific flags
|
||||
func platformFlags(flags *pflag.FlagSet) {
|
||||
flags.IntVarP(&Umask, "umask", "", Umask, "Override the permission bits set by the filesystem.")
|
||||
Umask = unix.Umask(0) // read the umask
|
||||
unix.Umask(Umask) // set it back to what it was
|
||||
UID = uint32(unix.Geteuid())
|
||||
GID = uint32(unix.Getegid())
|
||||
flags.Uint32VarP(&UID, "uid", "", UID, "Override the uid field set by the filesystem.")
|
||||
flags.Uint32VarP(&GID, "gid", "", GID, "Override the gid field set by the filesystem.")
|
||||
}
|
||||
Reference in New Issue
Block a user