mirror of
https://github.com/rclone/rclone.git
synced 2024-11-29 11:55:01 +01:00
ftp: Fix "501 Not a valid pathname." errors when creating directories
Some servers return a 501 error when using MLST on a non-existing directory. This patch allows it. I don't think this is correct usage according to the RFC, but the RFC doesn't explicitly state which error code should be returned for file/directory not found.
This commit is contained in:
parent
925c4382e2
commit
a9e7e7bcc2
@ -693,6 +693,12 @@ func (f *Fs) findItem(ctx context.Context, remote string) (entry *ftp.Entry, err
|
|||||||
if err == fs.ErrorObjectNotFound {
|
if err == fs.ErrorObjectNotFound {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
if errX := textprotoError(err); errX != nil {
|
||||||
|
switch errX.Code {
|
||||||
|
case ftp.StatusBadArguments:
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if entry != nil {
|
if entry != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user