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


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

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.