[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warn when editing read-only files
From: |
Paul Jackson |
Subject: |
Re: Warn when editing read-only files |
Date: |
Thu, 16 Nov 2023 23:41:10 -0600 |
User-agent: |
Cyrus-JMAP/3.9.0-alpha0-1108-g3a29173c6d-fm-20231031.005-g3a29173c |
The existing 'r' error messages explain an immediate and out right failure of
the read command itself.
The proposed error message are not be a failure of the 'r', but a warning of a
prospective 'w' failure.
Certainly, the 'r' command itself in that case must still succeed; I might have
intended only to read a file, not write it, and ed shouldn't stop me from doing
that, so long as it actually can read the file as requested. 'ed' has been my
primary editor for nearly 50 years, and I often read and browse a file using
it, with no intention to write it.
And, as someone else already noted, I can still write out my changes, say to a
/tmp file. If I actually did want those changes applied to the original
read-only (to me at the time), I can then leave ed, elevate my privilege, and
finish modifying that original file, using the tmp file as a draft. The edits
need not be lost to my long ago deceased and computer naive grandmother.
ed has never been in the business of 'anticipating thought crimes' ... it does
what I ask it to do, or tells me (perhaps with a terse '?') that it can't. It
doesn't anticipate what future errors I might be planning.
--
Paul Jackson
pj@usa.net
Re: Warn when editing read-only files, Antonio Diaz Diaz, 2023/11/20