Richard Zidlicky writes:
On Fri, Jun 05, 2009 at 11:36:04AM +0900, Stephen J. Turnbull wrote:
> If you don't mind explaining, how are you in this situation frequently
> enough to figure out what happened, let alone care? I don't think
> I've ever edited an existing file with zero-size. If there's a common
> workflow that leads to this, maybe there's more hurry than I thought.
it is very common for me - I use gnuclient as editor for the mutt
email client. Whenever mutt is asked to compose a new message it
will call gnuclient with a zero-sized temporary file.
Ah, that makes sense. All the tools I use that way (version control
programs, mostly) initialize the file with some nonempty content. Eg,
in the case of mail, I would expect the addressee and subject
headers. I guess Mutt has different way of doing that, so the initial
buffer is empty.
The temporary file must be created by mutt because otherwise it
would be hard to guarantee uniqueness - in principle other tools
calling an external editor on a newly created temporary file are
likely to hit the same bug.
Actually, I think most tools simply use something like tempnam and let
the editor create the file, but as that's insecure, I suppose more and
more will be using mkstemp, which would have the effect you observe.
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta