Ubuntu

emacs truncates files when out of disk space

Reported by Jean-Paul Calderone on 2009-02-11
4
Affects Status Importance Assigned to Milestone
emacs22 (Ubuntu)
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.

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  Edit
Everyone can see this information.

Other bug subscribers