From: Robert Klemme Date: 2008-01-12T07:25:02+09:00 Subject: Re: Counting the files in a directory.... On 11.01.2008 19:14, Kyle Schmitt wrote: > Entries seems to be fairly identical to collect, and it does look nicer... > but yea still slow. As I said: it's the IO for crowded directories (see also Mike's reply). > The problem with caching is that we only keep quarantine directories > around for 10 days, due to their size and the relative rarity of us > needing to pull something out of it. One reason for writing this as a > script is that we recover rarely enough that whoever is doing it > forgot how to recover. Still, it's often enough that we want to be > able to do it easily. > > In other cases than a mail system, caching would be a very good idea though. I am not sure I understand why you think it is a bad idea. If you only cache the number of files per directory where is the issue? Or is this script not invoked regularly? Probably I am missing a bit of your use case. > I'll try and read more of the C stuff for handling files/directories > in unix. I can hold out hope for awhile. Won't help. It's really the size of the directory. Maybe you give a little more detail about your script and when it's used so we can come up with better suggestions. Cheers robert