Cloud FS: don't propagate the error if removing a folder returns not found

for Cloud FS the folders are virtual and they, generally, disappear when the
last file is removed.

This fix doesn't work for FTP protocol for now.

Fixes #149
This commit is contained in:
Nicola Murino
2020-07-31 19:24:57 +02:00
parent 22338ed478
commit 2a9f7db1e2
9 changed files with 127 additions and 43 deletions

View File

@@ -252,6 +252,10 @@ func (c *BaseConnection) RemoveDir(fsPath, virtualPath string) error {
var fi os.FileInfo
var err error
if fi, err = c.Fs.Lstat(fsPath); err != nil {
// see #149
if c.Fs.IsNotExist(err) && c.Fs.HasVirtualFolders() {
return nil
}
c.Log(logger.LevelWarn, "failed to remove a dir %#v: stat error: %+v", fsPath, err)
return c.GetFsError(err)
}