azurefiles: improve modtime precision from 1s to 100ns
The server stores the SMB last write time with 100 ns (FILETIME) precision and returns it in full in listings, so advertise that as the precision instead of one second. This makes syncs preserve sub-second modtimes when comparing and copying files. Note that this means rclone will consider files with modtimes differing by less than a second as needing their modtime set where before it did not.
This commit is contained in:
@@ -253,10 +253,10 @@ func (f *Fs) Features() *fs.Features {
|
|||||||
|
|
||||||
// Precision return the precision of this Fs
|
// Precision return the precision of this Fs
|
||||||
//
|
//
|
||||||
// One second. FileREST API times are in RFC1123 which in the example shows a precision of seconds
|
// The SMB last write time properties are ISO 8601 with 100 ns (FILETIME) precision
|
||||||
// Source: https://learn.microsoft.com/en-us/rest/api/storageservices/representation-of-date-time-values-in-headers
|
// Source: https://learn.microsoft.com/en-us/rest/api/storageservices/representation-of-date-time-values-in-headers
|
||||||
func (f *Fs) Precision() time.Duration {
|
func (f *Fs) Precision() time.Duration {
|
||||||
return time.Second
|
return smbTimePrecision
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hashes returns the supported hash sets.
|
// Hashes returns the supported hash sets.
|
||||||
|
|||||||
@@ -115,8 +115,8 @@ rclone sync --interactive /home/local/directory remote:dir
|
|||||||
|
|
||||||
### Modified time
|
### Modified time
|
||||||
|
|
||||||
The modified time is stored as Azure standard `LastModified` time on
|
The modified time is stored as the SMB `LastWriteTime` property on
|
||||||
files
|
files. It has a precision of 100 ns.
|
||||||
|
|
||||||
### Performance
|
### Performance
|
||||||
|
|
||||||
|
|||||||
@@ -27,4 +27,4 @@ features:
|
|||||||
- WriteMimeType
|
- WriteMimeType
|
||||||
hashes:
|
hashes:
|
||||||
- md5
|
- md5
|
||||||
precision: 1000000000
|
precision: 100
|
||||||
|
|||||||
Reference in New Issue
Block a user