in reply to Re^3: failing to use getdents system call on Linux
in thread failing to use getdents system call on Linux

I'll try to do those suggestions and see what happens next.

About substr, I am already using it... so I'm not sure what do you mean by using it to emulate the C pointer. Even though I'm modifying the original buffer, I would expect that I would get at least the first entry correctly... I played around with unpack, but my guess is that I just don't have the same data on the perl buffer (neither identify what is being available over there, my guess is that I missing a long integer.

This is to solve a very specific problem with NFS exports: some directories got clobbered with so many files (above 300k) that even listing them with ls takes a lot of time. Unfortunately, I don't have root access to evaluate what is going over there, but using getdents allow me to get the list of files much more quickly.

That's what I need in most cases (I'll simply remove the files from there, no need to stat them.readdir() presents the same issues as ls.

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