help-gawk
[Top][All Lists]
Advanced

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

readdir extension on windows with getline


From: Jim Dailey
Subject: readdir extension on windows with getline
Date: Wed, 25 Jan 2023 16:48:49 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1

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?

Thanks,
FormerBiosGuy

GNU Awk 5.2.1, API 3.2, (GNU MPFR 4.0.2, GNU MP 6.1.2)

reply via email to

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