bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warn when editing read-only files


From: Dan Jacobson
Subject: Re: Warn when editing read-only files
Date: Fri, 17 Nov 2023 10:37:27 +0800

>>>>> "ADD" == Antonio Diaz Diaz <antonio@gnu.org> writes:
ADD> How do you propose to implement such a warning while remaining
ADD> POSIX-compliant?

Let's examine ed's helpful messages. I bet not all are listed in POSIX
page either.

$ ed /tmp/zzz
/tmp/zzz: No such file or directory # Helpful!
a
www
.
w
4
q
$ chmod 0 /tmp/zzz
$ ed /tmp/zzz
/tmp/zzz: Permission denied # Good to know!
a
www
.
w
/tmp/zzz: Permission denied # Expected! Can't blame anybody.
?
q
?
q
$ chmod 444 /tmp/zzz #and perhaps chown somebody_else /tmp/zzz
$ ed /tmp/zzz #Ho hum, every thing looks good...
4
a
www
.
w
/tmp/zzz: Permission denied # What? Why didn't you (ed) warn me above, with
# e.g., "Read-only file"! ed knew all along that the file was booby
# trapped, but didn't have a "sliver of gratitude" to at least warn me.
# So only after a long careful painstaking edit, it turns out "you might
# as well send your edit to your grandmother, because you are not going
# to save it where you thought you were before you bothered to start in
# the first place."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]