emacs truncates files when out of disk space
Bug #328287 reported by
Jean-Paul Calderone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
emacs22 (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: emacs22
Description: Ubuntu 8.04.2
Release: 8.04
emacs22:
Installed: 22.1-0ubuntu10.1
Candidate: 22.1-0ubuntu10.1
When trying to save a file when the target filesystem is full (ie, returning ENOSPC from I/O calls), emacs will truncate the file to zero bytes. It will not save any recovery data for the file (as might be expected, since there is no space to do so).
Instead, it should report that there is no space left and leave the existing contents of the file alone. Causing data loss in this situation is extremely (like, catastrophically) poor behavior.
To post a comment you must log in.
I can confirm this unfortunate behavior.
Doing some more testing this "only" seems to happen where there is the backupfile filename~ present. If there is no filename~ present emacs does seem to leave the original file un-truncated.