I do the same with is_file() in several scripts and it works just fine without clearing the cache. Don't know about dirs but I can't see why it may be different - should use the exact same functions internally.
On a side note, I'd rather recommend using a loop like <? global $mytmpdir; // usually "/tmp" -- you set this as you please globally $dd_prefix="$mytmpdir/temp_download_[project name here]"; $i=0; while (is_dir("$dd_prefix$i)) { $i++; } mkdir("$dd_prefix$i); ?> This way you have better control over the number of temp directories created, use the "official" temp directory and may use the same temp directory for several projects and still know which dir is used by what project. HTH Bogdan "Daniel Urstöger" wrote: > Hiya ! > > I am working on a download script right now, > and I have a question about a part of my code: > > do > { > $random_ID = rand(1000000000,9999999999); > $download_dir = "$today $random_ID"; > if (!@is_dir($download_dir)) > mkdir("$download_dir",0777); > }while(@!is_dir($download_dir)); > > So, I do this loop till the rand command generates a > ID which isn´t already in use ... > So I have now 2 calls of is_dir onto the same directory > in one loop. What do you think: > Do I need to use clearstatcache() or not ? > > thx for any comments ! > > And Merry XMas !! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]