When I edit a file in Emacs on my Ubuntu Linux system and try to save, I sometimes see the message:

File foo.txt has changed on disk. Really save? 

The weird thing is that I haven't changed it on disk, I'm just editing it in Emacs and nothing else. I've saved it myself a minute ago and that should be its last state. So some other process must be touching it behind my back, while I'm editing it.

Of course I can tell Emacs to save anyway, but I'm just curious why the file has allegedly changed without my knowledge.

Does anyone know this problem? What is a likely cause? Or is it possibly an Emacs bug?

  • What file? Is it a file in particular? – cYrus Oct 6 '10 at 0:58
  • It is just some random text file I am editing in my home directory, e.g. $HOME/foo.txt. – Frank Oct 6 '10 at 1:06
  • Does the file has really changed or just touched (changed the time stamps)? – cYrus Oct 6 '10 at 1:18
  • Hmm, I didn't check. I assume just the time stamp has changed for some reason ... – Frank Oct 6 '10 at 1:21
  • I don't know if this is a related problem, but sometimes it takes about a second or two to save a file ... :-( – Frank Oct 6 '10 at 1:38

If you are editing remote files on ftp server it is definitely clock sync problem. You have different time from remote host. Solution for that is to setup ntpd and sync it. That is how I solved my problem with remote host. Didn't have that kind of problems with local file editing.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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