in reply to Re^3: failing to use getdents system call on Linux
in thread failing to use getdents system call on Linux
Yup, the problem was with unpack indeed... I changed the line below from:
my ( $ino, $off, $len, $name ) = unpack( "LLSZ*", $buf );
To:
my ( $ino, $off, $len, $name ) = unpack( "L!L!SZ*", $buf );
And the program finally worked as expected:
[me@localhost ~]$ ./test2.pl -d sample/ | head sample/xaaaaaaaaff sample/xaaaaaaabdu sample/xaaaaaaabjw sample/xaaaaaaaaos sample/xaaaaaaaalu sample/xaaaaaaaags sample/xaaaaaaabci sample/xaaaaaaabhy sample/xaaaaaaabjv sample/xaaaaaaaaxa
All good, but some questions remains:
|
|---|