Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: failing to use getdents system call on Linux

by glasswalk3r (Friar)
on Nov 07, 2016 at 19:07 UTC ( [id://1175458]=note: print w/replies, xml ) Need Help??


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:

  1. What could have happened that cause this change in the system? Originally I didn't need to worry about that. Maybe some change related going from 32 to 64 bits platforms?
  2. How can I double check if I need to use "native" sizes with the unpack template? Besides the program malfunctions, of course. :-)
Alceu Rodrigues de Freitas Junior
---------------------------------
"You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1175458]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found