bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] gawk - 'inplace' feature ignores file's access flags (rea


From: Nethox
Subject: Re: [bug-gawk] gawk - 'inplace' feature ignores file's access flags (read-only)
Date: Sat, 13 Jun 2015 16:33:12 +0200

On Thu, Jun 11, 2015 at 2:38 PM, Andrew J. Schorr <address@hidden> wrote:
Thanks for sharing your thoughts.  But I really don't think we should focus on
what happens in bash when a user tries to change a file.  We are not in fact
changing the contents of a file; we are replacing it with a new file.  From a
filesystem perspective, that's a completely different operation.  That's why
none of the tools with inplace editing will respect the permissions on the
file.  The directory permissions are the relevant ones.

I think this feature should be called "replace editing" (or "in situ") instead of "in-place editing". Not only in gawk, but in every tool which cannot change a few bytes/lines without using a temporary file.
That would avoid unexpected and undesirable behavior such as the read-only file permission being ignored, the extra storage required and the poor performance with big files. Also, a self-documenting name avoids "bug vs feature" reports and discussions. http://backreference.org/2011/01/29/in-place-editing-of-files/
The extension was introduced in gawk 4.1.0 (2013-05) and is not specified by POSIX, so maybe it is not too late to take advantage of being the last implementer and fix this instead of spread it.
Regards.

reply via email to

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