"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
sftp: use uint32 for mtime
Tomasz Melcer27267547b903
diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.goindex fc3c8064d..28a71ea14 100644--- a/backend/sftp/sftp.go+++ b/backend/sftp/sftp.go@@ -561,7 +561,7 @@ type Object struct {fs *Fsremote stringsize int64 // size of the object- modTime time.Time // modification time of the object+ modTime uint32 // modification time of the object as unix timemode os.FileMode // mode bits from the filemd5sum *string // Cached MD5 checksumsha1sum *string // Cached SHA1 checksum@@ -1957,7 +1957,7 @@ func (o *Object) Size() int64 {// ModTime returns the modification time of the remote sftp filefunc (o *Object) ModTime(ctx context.Context) time.Time {- return o.modTime+ return time.Unix(int64(o.modTime), 0)}// path returns the native SFTP path of the object@@ -1972,7 +1972,7 @@ func (o *Object) shellPath() string {// setMetadata updates the info in the object from the stat result passed infunc (o *Object) setMetadata(info os.FileInfo) {- o.modTime = info.ModTime()+ o.modTime = info.Sys().(*sftp.FileStat).Mtimeo.size = info.Size()o.mode = info.Mode()}@@ -2195,7 +2195,7 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op// In the specific case of o.fs.opt.SetModTime == false// if the object wasn't found then don't return an errorfs.Debugf(o, "Not found after upload with set_modtime=false so returning best guess")- o.modTime = src.ModTime(ctx)+ o.modTime = uint32(src.ModTime(ctx).Unix())o.size = src.Size()o.mode = os.FileMode(0666) // regular file} else if err != nil {