[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: Thu, 16 Nov 2023 17:32:22 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv: Gecko/20110420 SeaMonkey/2.0.14

Dan Jacobson wrote:
Because ed does not warn when editing other peoples' files,
when it comes time to save the file, one might realize there is nowhere
to save it!

How do you propose to implement such a warning while remaining POSIX-compliant? (See 'Edit Command' at https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ed.html).

Some people may find disrupting that something like "Read-only file" is printed to stderr, and even more disrupting if it is printed to stdout.

John Cowan wrote:
It would be nice if ed understood ~ in pathnames, however.

This should be doable, as ed already uses HOME to save ed.hup in the user's home directory. Also, POSIX seems to say nothing against (or about) expanding '~' to $HOME in file names like '~/foo'.


reply via email to

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