From 4089e5af48226a84e2f95750e16b3a254677baa5 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Tue, 14 Jul 2026 12:43:41 +0100 Subject: [PATCH] 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. --- backend/azurefiles/azurefiles.go | 4 ++-- docs/content/azurefiles.md | 4 ++-- docs/data/backends/azurefiles.yaml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/azurefiles/azurefiles.go b/backend/azurefiles/azurefiles.go index db0b9262a..d31d6d78f 100644 --- a/backend/azurefiles/azurefiles.go +++ b/backend/azurefiles/azurefiles.go @@ -253,10 +253,10 @@ func (f *Fs) Features() *fs.Features { // 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 func (f *Fs) Precision() time.Duration { - return time.Second + return smbTimePrecision } // Hashes returns the supported hash sets. diff --git a/docs/content/azurefiles.md b/docs/content/azurefiles.md index b34b93c11..194f4b157 100644 --- a/docs/content/azurefiles.md +++ b/docs/content/azurefiles.md @@ -115,8 +115,8 @@ rclone sync --interactive /home/local/directory remote:dir ### Modified time -The modified time is stored as Azure standard `LastModified` time on -files +The modified time is stored as the SMB `LastWriteTime` property on +files. It has a precision of 100 ns. ### Performance diff --git a/docs/data/backends/azurefiles.yaml b/docs/data/backends/azurefiles.yaml index 44f0412ec..1d220dc6a 100644 --- a/docs/data/backends/azurefiles.yaml +++ b/docs/data/backends/azurefiles.yaml @@ -27,4 +27,4 @@ features: - WriteMimeType hashes: - md5 -precision: 1000000000 +precision: 100