http://qs321.pair.com?node_id=1148497


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.