emacs truncates files when out of disk space

Bug #328287 reported by Jean-Paul Calderone
4
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.

Revision history for this message
Andreas Olsson (andol) wrote :

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.

Changed in emacs22:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.