help-gawk
[Top][All Lists]
Advanced

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

Re: readdir extension on windows with getline


From: Eli Zaretskii
Subject: Re: readdir extension on windows with getline
Date: Thu, 26 Jan 2023 12:17:14 +0200

> Date: Wed, 25 Jan 2023 16:48:49 -0600
> From: Jim Dailey <jim.dailey@alumni.utexas.net>
> 
> I have successfully used the readdir extension on windows with directory
> names on the command line.
> 
> But if I try to execute "getline < {some directory path}", my script 
> hangs. I
> have to Ctrl-C to get control.  Ctrl-Z (EOF) does nothing to move things 
> along.
> 
> I have tried using getline with a directory path in BEGIN, in END, and in a
> normal pattern, each time with the same result.
> 
> It seems like the extension doesn't work with getline on windows. Here 
> is the
> basic attempt:
> 
>      PathCount = split(ENVIRON["AWKPATH"],AwkPath,/;/)
>      for (i = 1; i <= PathCount; i++) {
>          while (getline < AwkPath[i]) {
>              split($0,Data,/\//)
>              print Data[2]
>          }
>      }
> 
> If I replace AwkPath[i] with an actual path like 
> "C:\etc\pscal\pscal\gawk\lib",
> there is no change in behavior.
> 
> If you have successfully used readdir with getline in windows, perhaps 
> you have
> some idea what I may be doing incorrectly?

I get the same results on Windows and on GNU/Linux.

AFAICT, the readdir extension cannot be used with getline, since
getline redirection seems to ignore the registered input parsers.

IOW, this is not currently supported.



reply via email to

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