"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
swift: Make sure we read the size for 0 length files - Fixes #237
Nick Craig-Wood8369b5209fc6
diff --git a/swift/swift.go b/swift/swift.goindex 6e98c03ff..f3662abdf 100644--- a/swift/swift.go+++ b/swift/swift.go@@ -210,6 +210,12 @@ func (f *Fs) newFsObjectWithInfo(remote string, info *swift.Object) fs.Object {fs: f,remote: remote,}+ // Note that due to a quirk of swift, manifest files are+ // returned as 0 bytes in the listing. Correct this here by+ // making sure we read the full metadata for all 0 byte files.+ if info != nil && info.Bytes == 0 {+ info = nil+ }if info != nil {// Set info but not headerso.info = *info@@ -537,9 +543,8 @@ func (o *Object) SetModTime(modTime time.Time) {// Storable returns if this object is storable//-// It reads the metadata for <= directoryMarkerMaxSize byte objects then compares the-// Content-Type to directoryMarkerContentType - that makes it a-// directory marker which is not storable.+// It compares the Content-Type to directoryMarkerContentType - that+// makes it a directory marker which is not storable.func (o *Object) Storable() bool {return o.info.ContentType != directoryMarkerContentType}