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: Tue, 16 Jun 2015 15:30:05 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Tue, Jun 16, 2015 at 01:05:16PM -0600, Bob Proulx wrote:
> > bash-4.2$ echo hello > test
> > bash-4.2$ echo junk >> test
> > bash-4.2$ gawk -l select -i inplace '{print $0, "more stuff"; 
> > kill(PROCINFO["pid"], "term")}' test
> > Terminated
> > bash-4.2$ ls -l
> > total 8
> > -rw-r--r-- 1 schorr ead 11 Jun 16 14:50 test
> > -rw-r--r-- 1 schorr ead 17 Jun 16 14:50 test.gawk.J5rOK8
> 
> Good catch!  That looks like an bug to me.  It created a temporary
> file.  It should clean it up if it is interrupted and can't complete.
> This looks like a good bug to report.

This is the bug report list, so I don't know where else to report it. :-)

> (Many programs create and handle temporary files.  The sort command for
> example.  There are many examples to pull from.)
> 
> > Do sed and perl trap signals properly?
> 
> I had thought so.  But I have not looked.

The challenge here is that it's a tricky thing to muck around with signal
trapping inside gawk.  There are some places where signals are trapped for
certain reasons, and there's also an ability for gawk programs to trap their
own signals.  When profiling is enabled, that traps certain signals.  So I'm
uncertain about whether or how to fix this...

Regards,
Andy



reply via email to

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