bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [gawk-stable] bug: fatal error when getline from directory


From: Paolo
Subject: Re: [gawk-stable] bug: fatal error when getline from directory
Date: Mon, 5 Jan 2009 23:27:40 +0100
User-agent: Mutt/1.3.28i

On Mon, Jan 05, 2009 at 10:20:03PM +0200, Eli Zaretskii wrote:
> disagree with Posix, I thought something less complex will do;
> evidently, it doesn't.

yup, I'm ever more confused
 
> > then awk couldn't process eg b64-encoded
> > email msgs
> 
> Not true: you are confusing text with its encoding.

oh, I see ... dazed & confused.
 
> I/O is core Gawk functionality; you cannot extend it around the design
> limitations of that.

really? what about '/inet/' extension?

@Aharon: 

pls see attached diffs, it's just a POC for '/dir/' extension - I 
know it'd be in extension/, likely not portable etc., and likely won't
ever make it into official code - but just for fun and perhaps future ref,
eg:

$./gawk 'BEGIN{r=1
$       while (r==1) {
$           r=getline < "/tmp"; print "r="r" -"$0"- ERRNO=" ERRNO
$         }
$       }'
r=-1 -- ERRNO=Is a directory 

$./gawk 'BEGIN{r=1
$       while (r==1) {
$           r=getline < "/tmp/xrdb.wdm.log"; print "r="r" -"$0"- ERRNO=" ERRNO
$         }
$       }'
r=1 ---help- ERRNO=0
r=1 -- ERRNO=0
r=0 -- ERRNO=0

$./gawk 'BEGIN{r=1
$       while (r==1) {
$           r=getline < "/dir//tmp/rd.c"; print "r="r" -"$0"- ERRNO=" ERRNO
$         }
$       }'
gawk: warning: could not open `/dir//tmp/rd.c', mode `r'
r=-1 -- ERRNO=Not a directory

$./gawk 'BEGIN{r=1
$       while (r==1) {
$           r=getline < "/dir//tmp"; print "r="r" -"$0"- ERRNO=" ERRNO
$         }
$       }'
r=1 -.- ERRNO=0
r=1 -..- ERRNO=0
r=1 -rd- ERRNO=0
r=1 -.clean- ERRNO=0
r=1 -orbit-central- ERRNO=0
r=1 -rd.c- ERRNO=0
r=1 -mc-amsis- ERRNO=0
r=1 -xrdb.wdm.amsis.log- ERRNO=0
r=1 -xrdb.wdm.log- ERRNO=0
r=1 -gconfd-central- ERRNO=0
r=1 -lost+found- ERRNO=0
r=1 -.X11-unix- ERRNO=0
r=1 -.X0-lock- ERRNO=0
r=1 -.font-unix- ERRNO=0
r=1 -xrdb.wdm..log- ERRNO=0
r=1 -hsperfdata_central- ERRNO=0
r=0 -hsperfdata_central- ERRNO=0

not too bad eh? ;-P
[Warning: it's a quick hack, unvetted code]

> As is arguing with you, since you evidently disagree with anything and
> anyone but yourself.

weak arguments, if any
 

-- 
 paolo
 

Attachment: gawk_io.c+dirext.diff
Description: Text document

Attachment: gawk_awk.h+dirext.diff
Description: Text document


reply via email to

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