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: Andrew L. Moore
Subject: Re: Warn when editing read-only files
Date: Mon, 11 Dec 2023 21:32:02 -0500
User-agent: Mozilla Thunderbird

On 12/11/23 10:12 AM, Antonio Diaz Diaz wrote:
Andrew L. Moore wrote:
Antonio Diaz Diaz <antonio@gnu.org> writes:
] How do you propose to implement such a warning while remaining
] POSIX-compliant?

In github.com/slewsys/ed this is implemented by reporting 'Read-only' if
ed is in verbose mode:

$ ed -v /etc/os-release
/etc/os-release: File is read-only
735

I find it less intrusive what is already implemented in GNU ed 1.20-pre3; warn only if trying to modify the buffer:

$ ed /etc/profile
2840
1d
/etc/profile: warning: read-only file

Antonio,
I would encourage you to re-read and reflect upon Dan Jacobson's observations: the user is best served if informed from the outset.
-AM



reply via email to

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