On 12/11/23 10:12 AM, Antonio Diaz Diaz wrote:
Andrew L. Moore wrote:
Antonio Diaz Diaz <anto...@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