Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Script to delete huge sparsebundle images' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Script to delete huge sparsebundle images
Authored by: bdm on Jul 20, '12 06:22:14AM

There is a possible reason for slow behaviour that hasn't been mentioned. A directory file has an internal structure consisting of a sequence of records, one per file, with the inode number, the name of the file, etc. Do "man 5 dir" to see the details. The records are of different sizes because they depend on the file name length, so there is a non-trivial memory management problem if there are a large number of files. When you delete a file the structure has to be cleaned up and this can take a while. I haven't tested MacOSX in this regard, but I remember SunOS used to have a quadratic algorithm in it so deleting the files from a large directory in random order took approximately forever. Some of the tests being reported here where the files have mostly the same length names and are deleted in approximately they same order as they were created are not likely to find the worst case.

[ Reply to This | # ]