0

I get this constantly when I try to save a file on an SMB drive.

If I abort, then hit save again, it works.

I believe there is some time difference between the two files, or something like that, which somehow catches up again.

This is a hard bug to debug, so I'm looking for ways to be smart about it.

I imagine the first thing I can try, is have Emacs report what times it reads on the two files?

Can we augment the function to display this?

1 Answer 1

1

Yes, you could augment it to include the times in the message if you want.

But ultimately the fix needs to be in your server. Something is changing the modification timestamps on your files after you save them. Perhaps a backup process running on the server? Perhaps the SMB server is implementing write caching in a way that delays the assignment of the modification timestamp? There’s no way for us to know.

Edit:

It occurs to me that I forgot to mention the simplest possible cause. The clocks on the server and on your PC might not be in sync. If your PC thinks that it is 5:00pm, but the server’s clock says that it is 5:01pm, then when next you save the file Emacs will read 5:01pm as the modification time of the file and think that someone (or some other process) has modified the file when Emacs wasn’t looking. The best way to fix this is for both your PC and your server to synchronize their clocks to the same NTP server. Again, this is out of scope for the Emacs StackExchange, but you can search your server’s documentation for NTP or clock synchronization to figure out how to configure it correctly.

3
  • , but I first need to know that time is relevant here. I only assume it's time it's considering, when it displays that message. Commented May 3 at 18:35
  • Yes, time is relevant. It’s the only thing any program can use to make this judgement. It is literally the whole reason why your filesystem bothers to track creation and modification timestamps at all.
    – db48x
    Commented May 3 at 23:59
  • The two systems are both on NTP, but most likely are not using the same NTP server, but if this is the culprit, then I wonder why I don't see a ton of bug reports on this. Surely, a few milliseconds can't cause this irritating bug? I will try to make both system use the same NTP server, but I just can't fathom that this is the cause, rather a red herring;) Commented May 4 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.