Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

ftp: fix mkdir with rsftp which is returning the wrong code

Nick Craig-Wood24fdecf10788
diff --git a/backend/ftp/ftp.go b/backend/ftp/ftp.go
index aab419779..6c7e7b105 100644
--- a/backend/ftp/ftp.go
+++ b/backend/ftp/ftp.go
@@ -970,6 +970,8 @@ func (f *Fs) mkdir(ctx context.Context, abspath string) error {
f.putFtpConnection(&c, err)
if errX := textprotoError(err); errX != nil {
switch errX.Code {
+ case ftp.StatusRequestedFileActionOK: // some ftp servers apparently return 250 instead of 257
+ err = nil // see: https://forum.rclone.org/t/rclone-pop-up-an-i-o-error-when-creating-a-folder-in-a-mounted-ftp-drive/44368/
case ftp.StatusFileUnavailable: // dir already exists: see issue #2181
err = nil
case 521: // dir already exists: error number according to RFC 959: issue #2363