mirror of
https://github.com/rclone/rclone.git
synced 2025-01-09 07:48:19 +01:00
fs: Implement PartialUploads feature flag
Implement a Partialuploads feature flag to mark backends for which uploads are not atomic. This is set for the following backends - local - ftp - sftp See #3770
This commit is contained in:
parent
aaacfa51a0
commit
cc01223535
@ -580,6 +580,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (ff fs.Fs
|
|||||||
}
|
}
|
||||||
f.features = (&fs.Features{
|
f.features = (&fs.Features{
|
||||||
CanHaveEmptyDirectories: true,
|
CanHaveEmptyDirectories: true,
|
||||||
|
PartialUploads: true,
|
||||||
}).Fill(ctx, f)
|
}).Fill(ctx, f)
|
||||||
// set the pool drainer timer going
|
// set the pool drainer timer going
|
||||||
if f.opt.IdleTimeout > 0 {
|
if f.opt.IdleTimeout > 0 {
|
||||||
|
@ -303,6 +303,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
|||||||
WriteMetadata: true,
|
WriteMetadata: true,
|
||||||
UserMetadata: xattrSupported, // can only R/W general purpose metadata if xattrs are supported
|
UserMetadata: xattrSupported, // can only R/W general purpose metadata if xattrs are supported
|
||||||
FilterAware: true,
|
FilterAware: true,
|
||||||
|
PartialUploads: true,
|
||||||
}).Fill(ctx, f)
|
}).Fill(ctx, f)
|
||||||
if opt.FollowSymlinks {
|
if opt.FollowSymlinks {
|
||||||
f.lstat = os.Stat
|
f.lstat = os.Stat
|
||||||
|
@ -994,6 +994,7 @@ func NewFsWithConnection(ctx context.Context, f *Fs, name string, root string, m
|
|||||||
f.features = (&fs.Features{
|
f.features = (&fs.Features{
|
||||||
CanHaveEmptyDirectories: true,
|
CanHaveEmptyDirectories: true,
|
||||||
SlowHash: true,
|
SlowHash: true,
|
||||||
|
PartialUploads: true,
|
||||||
}).Fill(ctx, f)
|
}).Fill(ctx, f)
|
||||||
// Make a connection and pool it to return errors early
|
// Make a connection and pool it to return errors early
|
||||||
c, err := f.getSftpConnection(ctx)
|
c, err := f.getSftpConnection(ctx)
|
||||||
|
@ -30,6 +30,7 @@ type Features struct {
|
|||||||
WriteMetadata bool // can write metadata to objects
|
WriteMetadata bool // can write metadata to objects
|
||||||
UserMetadata bool // can read/write general purpose metadata
|
UserMetadata bool // can read/write general purpose metadata
|
||||||
FilterAware bool // can make use of filters if provided for listing
|
FilterAware bool // can make use of filters if provided for listing
|
||||||
|
PartialUploads bool // uploaded file can appear incomplete on the fs while it's being uploaded
|
||||||
|
|
||||||
// Purge all files in the directory specified
|
// Purge all files in the directory specified
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user