Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by glasswalk3r (Friar)
on Nov 04, 2016 at 00:26 UTC ( [id://1175271]=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

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-04-26 00:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found