[Top][All Lists]

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

Re: Warn when editing read-only files

From: Antonio Diaz Diaz
Subject: Re: Warn when editing read-only files
Date: Mon, 11 Dec 2023 16:12:35 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv: Gecko/20110420 SeaMonkey/2.0.14

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

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
/etc/profile: warning: read-only file

reply via email to

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