Hello,
I'm wanting to take advantage of the readdir.so dynamic library that
ships with gawk but I'm having an issue on the target system which the >following test code reveals:
Hello,
I'm wanting to take advantage of the readdir.so dynamic library that
ships with gawk but I'm having an issue on the target system which the following test code reveals:
[snip]
Output on my home system look fine but on the target system I get the following errors/warnings right after the /proc/sys directory listing
which I don't understand:
#-- error msg --
awk: cmd. line:1: warning: dir_take_control_of: opendir/fdopendir
failed: Not a directory
awk: cmd. line:1: warning: input parser `readdir' failed to open `/proc/sys/kernel/version'
#-- ----- --- --
# Static table lookup for hostnames.
# See hosts(5) for details.
Hello,
I'm wanting to take advantage of the readdir.so dynamic library that
ships with gawk but I'm having an issue on the target system which the >following test code reveals:
#-- test code --
@load "readdir"
BEGIN{
d="/proc/sys"
f=d"/kernel/version"
FS="/"
while(getline<d)
if($3=="d")
print $2
close(d)
FS=" "
while(getline<f)
print $0
close(f)
print "\nGNU Awk",PROCINFO["version"]
}
#-- ---- ---- --
Output on my home system look fine but on the target system I get the >following errors/warnings righ
Mack The Knife forwarded your report to me. This kind of
question would have been better sent to the bug-gawk list,
as you've found an actual bug. (The first real bug for 5.2.2, congratulations! 😄
The bug is due to a change in the readdir extension that
occurred with the 5.2.2 release. Here is a patch.
Thanks,
Arnold
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 27:39:48 |
Calls: | 10,390 |
Calls today: | 1 |
Files: | 14,064 |
Messages: | 6,417,072 |