Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^2: using Linux getdents syscall

by glasswalk3r (Friar)
on Nov 24, 2015 at 12:18 UTC ( #1148497=note: print w/replies, xml ) Need Help??

in reply to Re: using Linux getdents syscall
in thread using Linux getdents syscall

Thanks for the tips!

Considering that $buf might have multiple dentries inside of it, how do I navigate thru all those records? For C is easy because I'm accessing memory directly, but how do I know how many bytes I should read from $buf and how to move to the next record with Perl?

Alceu Rodrigues de Freitas Junior
"You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill

Replies are listed 'Best First'.
Re^3: using Linux getdents syscall
by andal (Hermit) on Nov 25, 2015 at 07:50 UTC

    I've already put it in the code. The variable $len contains total length of single dirent structure. So, all you have to do is to remove this many bytes from the beginning of the buffer.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2022-05-23 02:16 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (81 votes). Check out past polls.