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 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'
#-- ----- --- --
Versioning (last line in code):
- home system: GNU Awk ver: 5.1.0
- target system: GNU Awk ver: 5.2.2
Other info for target machine:
- OS = Arch Linux (64bit)
- AWKLIBPATH = /usr/lib/gawk
- $ gawk --version |head -n1
GNU Awk 5.2.2, API 3.2, PMA Avon 8-g1, (GNU MPFR 4.2.0-p9, GNU MP6.2.1)
Does this look like a fixable configuration quirk not requiring
recompiling or something else? I'm not admin on the target system but >benign configuration tweaks would likely be an option.
-J
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: | DaiTengu |
---|---|
Location: | Appleton, WI |
Users: | 920 |
Nodes: | 10 (0 / 10) |
Uptime: | 102:49:35 |
Calls: | 12,189 |
Calls today: | 1 |
Files: | 186,527 |
Messages: | 2,237,488 |