[comp.editors] vi Warning: ":wq" may destroy your file

meyering@cs.utexas.edu (Jim Meyering) (10/21/90)

In discussing minimal vi command sets for beginners, this is one
of the commands suggested.

    >:wq  write (save edits) and quit

Please be careful when using this command on files in nearly full
disk partitions.  In at least one releas of Sun's (I think it was
Sun Unix 3.5) vi, this command *attempts* to write the file, then
quits unconditionally, EVEN IF THE WRITE FAILED.  Use `:x' instead.
Or use :w, then :q.  This wouldn't be such a big deal, but when
this bug is exercised, you'll lose the entire file, not just your
modifications.

I haven't tested vi for this bug on other systems/releases, but noticed
that a fix wasn't mentioned in the SunOS 4.1 bug fixes posted here
recently.
-- 
Jim Meyering          meyering@cs.utexas.edu