bug-gawk
[Top][All Lists]
Advanced

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

Re: Native file exist check


From: Wolfgang Laun
Subject: Re: Native file exist check
Date: Fri, 5 Jun 2020 19:56:31 +0200

It's interesting that ".." and ".?" work, but not a single period ".".
-W

On Fri, 5 Jun 2020 at 19:12, Wolfgang Laun <wolfgang.laun@gmail.com> wrote:

> This regex does the trick:
>     RS = "[^x]|x"
> -W
>
> On Fri, 5 Jun 2020 at 17:28, Andrew J. Schorr <
> aschorr@telemetry-investments.com> wrote:
>
>> On Fri, Jun 05, 2020 at 10:25:55AM -0500, Neil R. Ormos wrote:
>> > Neil R. Ormos wrote:
>> > > Peng Yu wrote:
>> > >
>> > > > https://stackoverflow.com/questions/29284472/awk-check-file-exists
>> > > >
>> > > > The following solution is shown above. But getline could potentially
>> > > > read too much (for example processing a binary file in which a line
>> > > > can be very long). [...]
>> > >
>> > > Consider whether setting RS to "." resolves the concern that getline
>> might read "too much".
>> > >
>> > >   <
>> https://www.gnu.org/software/gawk/manual/gawk.html#gawk-split-records>
>> > >
>> >
>> > CORRECTION:  Consider whether setting RS to ".." resolves the concern
>> that getline might read "too much".
>> >
>> > At least for gawk.
>>
>> Yes -- that works well. I had tried ".*", which does not work, for
>> reasons that
>> are not obvious to me.
>>
>>


reply via email to

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