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: Aharon Robbins
Subject: Re: [gawk-stable] bug: fatal error when getline from directory
Date: Sun, 04 Jan 2009 06:13:27 +0200

> Date: Sat, 3 Jan 2009 16:01:01 -0500
> To: Aharon Robbins <address@hidden>
> Cc: address@hidden, address@hidden, address@hidden,
>         address@hidden
> Subject: Re: [gawk-stable] bug: fatal error when getline from directory
> From: John Cowan <address@hidden>
>
> Aharon Robbins scripsit:
>
> >     gawk: (FILENAME=a FNR=1) fatal: cannot open file `/tmp' for reading 
> > (Success)
>
> A fatal success, eh?  :-)
>
> > I will consult with the other awk authors before I decide what to do.
>
> I think the Most Awkish Thing is to treat a directory as a RS-terminated
> list of file names.

This isn't so simple; what if someone puts a \n into their filenames?

Portability is also an issue here; readdir(3) has to be supported for
this to work everywhere - is it? (OS/2, VMS...)

It is just as legitimate to say that if a user hands awk a directory it's
their fault things don't work.

As I said, I want to think about this some more and consult with the
other awk authors.  Reading directories is a good opportunity for
a gawk plug-in of some kind.

Thanks,

Arnold




reply via email to

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