mirror of
https://github.com/rclone/rclone.git
synced 2025-11-23 21:44:49 +02:00
vfs: convert vfs options to new style
This also - move in use options (Opt) from vfsflags to vfscommon - change os.FileMode to vfscommon.FileMode in parameters - rework vfscommon.FileMode and add tests
This commit is contained in:
@@ -204,7 +204,7 @@ func New(f fs.Fs, opt *vfscommon.Options) *VFS {
|
||||
if opt != nil {
|
||||
vfs.Opt = *opt
|
||||
} else {
|
||||
vfs.Opt = vfscommon.DefaultOpt
|
||||
vfs.Opt = vfscommon.Opt
|
||||
}
|
||||
|
||||
// Fill out anything else
|
||||
@@ -776,7 +776,7 @@ func (vfs *VFS) AddVirtual(remote string, size int64, isDir bool) (err error) {
|
||||
} else {
|
||||
// Create parent of virtual directory since backend can't have empty directories
|
||||
parent, leaf = path.Split(remote)
|
||||
dir, err = vfs.mkdirAll(parent, vfs.Opt.DirPerms)
|
||||
dir, err = vfs.mkdirAll(parent, os.FileMode(vfs.Opt.DirPerms))
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user