mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 07:29:35 +01:00
mount: add --no-seek flag to disable seeking
This commit is contained in:
parent
e94850f322
commit
f45b3c87bf
@ -114,6 +114,9 @@ func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenR
|
|||||||
|
|
||||||
switch {
|
switch {
|
||||||
case req.Flags.IsReadOnly():
|
case req.Flags.IsReadOnly():
|
||||||
|
if noSeek {
|
||||||
|
resp.Flags |= fuse.OpenNonSeekable
|
||||||
|
}
|
||||||
return newReadFileHandle(o)
|
return newReadFileHandle(o)
|
||||||
case req.Flags.IsWriteOnly():
|
case req.Flags.IsWriteOnly():
|
||||||
resp.Flags |= fuse.OpenNonSeekable
|
resp.Flags |= fuse.OpenNonSeekable
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
var (
|
var (
|
||||||
noModTime = false
|
noModTime = false
|
||||||
debugFUSE = false
|
debugFUSE = false
|
||||||
|
noSeek = false
|
||||||
// mount options
|
// mount options
|
||||||
readOnly = false
|
readOnly = false
|
||||||
allowNonEmpty = false
|
allowNonEmpty = false
|
||||||
@ -43,6 +44,7 @@ func init() {
|
|||||||
cmd.Root.AddCommand(mountCmd)
|
cmd.Root.AddCommand(mountCmd)
|
||||||
mountCmd.Flags().BoolVarP(&noModTime, "no-modtime", "", noModTime, "Don't read the modification time (can speed things up).")
|
mountCmd.Flags().BoolVarP(&noModTime, "no-modtime", "", noModTime, "Don't read the modification time (can speed things up).")
|
||||||
mountCmd.Flags().BoolVarP(&debugFUSE, "debug-fuse", "", debugFUSE, "Debug the FUSE internals - needs -v.")
|
mountCmd.Flags().BoolVarP(&debugFUSE, "debug-fuse", "", debugFUSE, "Debug the FUSE internals - needs -v.")
|
||||||
|
mountCmd.Flags().BoolVarP(&noSeek, "no-seek", "", noSeek, "Don't allow seeking in files.")
|
||||||
// mount options
|
// mount options
|
||||||
mountCmd.Flags().BoolVarP(&readOnly, "read-only", "", readOnly, "Mount read-only.")
|
mountCmd.Flags().BoolVarP(&readOnly, "read-only", "", readOnly, "Mount read-only.")
|
||||||
mountCmd.Flags().BoolVarP(&allowNonEmpty, "allow-non-empty", "", allowNonEmpty, "Allow mounting over a non-empty directory.")
|
mountCmd.Flags().BoolVarP(&allowNonEmpty, "allow-non-empty", "", allowNonEmpty, "Allow mounting over a non-empty directory.")
|
||||||
|
Loading…
Reference in New Issue
Block a user