sftp: implement DirSetModTime
This commit is contained in:
parent
cbcb295185
commit
17c0ecc72c
2 changed files with 20 additions and 10 deletions
|
@ -1367,6 +1367,15 @@ func (f *Fs) Mkdir(ctx context.Context, dir string) error {
|
||||||
return f.mkdir(ctx, root)
|
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
|
// Rmdir removes the root directory of the Fs object
|
||||||
func (f *Fs) Rmdir(ctx context.Context, dir string) error {
|
func (f *Fs) Rmdir(ctx context.Context, dir string) error {
|
||||||
// Check to see if directory is empty as some servers will
|
// 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)
|
return fmt.Errorf("SetModTime failed: %w", err)
|
||||||
}
|
}
|
||||||
err = o.stat(ctx)
|
err = o.stat(ctx)
|
||||||
if err != nil {
|
if err != nil && err != fs.ErrorIsDir {
|
||||||
return fmt.Errorf("SetModTime stat failed: %w", err)
|
return fmt.Errorf("SetModTime stat failed: %w", err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -2179,12 +2188,13 @@ func (o *Object) Remove(ctx context.Context) error {
|
||||||
|
|
||||||
// Check the interfaces are satisfied
|
// Check the interfaces are satisfied
|
||||||
var (
|
var (
|
||||||
_ fs.Fs = &Fs{}
|
_ fs.Fs = &Fs{}
|
||||||
_ fs.PutStreamer = &Fs{}
|
_ fs.PutStreamer = &Fs{}
|
||||||
_ fs.Mover = &Fs{}
|
_ fs.Mover = &Fs{}
|
||||||
_ fs.Copier = &Fs{}
|
_ fs.Copier = &Fs{}
|
||||||
_ fs.DirMover = &Fs{}
|
_ fs.DirMover = &Fs{}
|
||||||
_ fs.Abouter = &Fs{}
|
_ fs.DirSetModTimer = &Fs{}
|
||||||
_ fs.Shutdowner = &Fs{}
|
_ fs.Abouter = &Fs{}
|
||||||
_ fs.Object = &Object{}
|
_ 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 | - |
|
| QingStor | MD5 | - ⁹ | No | No | R/W | - |
|
||||||
| Quatrix by Maytech | - | R/W | No | No | - | - |
|
| Quatrix by Maytech | - | R/W | No | No | - | - |
|
||||||
| Seafile | - | - | No | No | - | - |
|
| Seafile | - | - | No | No | - | - |
|
||||||
| SFTP | MD5, SHA1 ² | R/W | Depends | No | - | - |
|
| SFTP | MD5, SHA1 ² | DR/W | Depends | No | - | - |
|
||||||
| Sia | - | - | No | No | - | - |
|
| Sia | - | - | No | No | - | - |
|
||||||
| SMB | - | R/W | Yes | No | - | - |
|
| SMB | - | R/W | Yes | No | - | - |
|
||||||
| SugarSync | - | - | No | No | - | - |
|
| SugarSync | - | - | No | No | - | - |
|
||||||
|
|
Loading…
Reference in a new issue