mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 10:54:48 +08:00
sftp: implement DirSetModTime
This commit is contained in:
parent
cbcb295185
commit
17c0ecc72c
|
@ -1367,6 +1367,15 @@ func (f *Fs) Mkdir(ctx context.Context, dir string) error {
|
|||
return f.mkdir(ctx, root)
|
||||
}
|
||||
|
||||
// DirSetModTime sets the directory modtime for dir
|
||||
func (f *Fs) DirSetModTime(ctx context.Context, dir string, modTime time.Time) error {
|
||||
o := Object{
|
||||
fs: f,
|
||||
remote: dir,
|
||||
}
|
||||
return o.SetModTime(ctx, modTime)
|
||||
}
|
||||
|
||||
// Rmdir removes the root directory of the Fs object
|
||||
func (f *Fs) Rmdir(ctx context.Context, dir string) error {
|
||||
// Check to see if directory is empty as some servers will
|
||||
|
@ -1985,7 +1994,7 @@ func (o *Object) SetModTime(ctx context.Context, modTime time.Time) error {
|
|||
return fmt.Errorf("SetModTime failed: %w", err)
|
||||
}
|
||||
err = o.stat(ctx)
|
||||
if err != nil {
|
||||
if err != nil && err != fs.ErrorIsDir {
|
||||
return fmt.Errorf("SetModTime stat failed: %w", err)
|
||||
}
|
||||
return nil
|
||||
|
@ -2179,12 +2188,13 @@ func (o *Object) Remove(ctx context.Context) error {
|
|||
|
||||
// Check the interfaces are satisfied
|
||||
var (
|
||||
_ fs.Fs = &Fs{}
|
||||
_ fs.PutStreamer = &Fs{}
|
||||
_ fs.Mover = &Fs{}
|
||||
_ fs.Copier = &Fs{}
|
||||
_ fs.DirMover = &Fs{}
|
||||
_ fs.Abouter = &Fs{}
|
||||
_ fs.Shutdowner = &Fs{}
|
||||
_ fs.Object = &Object{}
|
||||
_ fs.Fs = &Fs{}
|
||||
_ fs.PutStreamer = &Fs{}
|
||||
_ fs.Mover = &Fs{}
|
||||
_ fs.Copier = &Fs{}
|
||||
_ fs.DirMover = &Fs{}
|
||||
_ fs.DirSetModTimer = &Fs{}
|
||||
_ fs.Abouter = &Fs{}
|
||||
_ fs.Shutdowner = &Fs{}
|
||||
_ fs.Object = &Object{}
|
||||
)
|
||||
|
|
|
@ -52,7 +52,7 @@ Here is an overview of the major features of each cloud storage system.
|
|||
| QingStor | MD5 | - ⁹ | No | No | R/W | - |
|
||||
| Quatrix by Maytech | - | R/W | No | No | - | - |
|
||||
| Seafile | - | - | No | No | - | - |
|
||||
| SFTP | MD5, SHA1 ² | R/W | Depends | No | - | - |
|
||||
| SFTP | MD5, SHA1 ² | DR/W | Depends | No | - | - |
|
||||
| Sia | - | - | No | No | - | - |
|
||||
| SMB | - | R/W | Yes | No | - | - |
|
||||
| SugarSync | - | - | No | No | - | - |
|
||||
|
|
Loading…
Reference in New Issue
Block a user