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: Andrew J. Schorr
Subject: Re: [bug-gawk] gawk - 'inplace' feature ignores file's access flags (read-only)
Date: Wed, 10 Jun 2015 11:45:41 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

Hi,

On Wed, Jun 10, 2015 at 05:35:41PM +0200, Janis Papanagnou wrote:
>  > I don't think it's a bug.
> 
> Okay, fine.
> 
> >  The fact that every other tool handles this the same way
> 
> (My experience here is that only because many others do it in one
> way makes it not the right way; often someone started somehow
> and others copied it mindlessly. This has never been a substitute
> for a reasonable rationale. Such a statement is a dead end.)

I agree that this does not prove anything.  But gawk is late to the party
with support for inplace editing, and I think it can be useful to look
at how other tools implement this feature.  One presumes that they all
use a similar mechanism.  We are not changing the file, just replacing it.
So we care only about the directory's permissions.

> >  We are not modifying the
> > file.  We are creating a new file and then replacing it.  As such, it is
> > the directory's permissions that matter, not the file's.  Furthermore,
> > you can provide INPLACE_SUFFIX to save a copy of the original file.
> 
> The application case I mentioned is different, not at all about backups.

Sorry.  I see from comp.lang.awk that what you really want is to disable
the inplace feature for a single file.  Using "chmod -w" is not a great
solution to that problem, I think.

Regards,
Andy



reply via email to

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