note 75248 added to function.is-dir

From: Date: Sun, 20 May 2007 13:33:25 +0000
Subject: note 75248 added to function.is-dir
Groups: php.notes 
Request: Send a blank email to php-notes+get-126717@lists.php.net to get a copy of this message
I had troubles at checking for the existance of a directory under the windows temporary path (usually c:\windows\temp\). I am using PHP 5.2.0 See also the bug tracker item: http://bugs.php.net/bug.php?id=39198 Here below the replacement function which works under the Windows temporary directory. It is a bad hack, since it creates and then removes the directory to verify its existance! But I could not find an alternative solution, that bug should be fixed. <?php function temp_is_dir($dir) { // check directory existance under temp folder (tested on Windows) // see bug #31918 http://bugs.php.net/bug.php?id=39198 // by legolas558 if (!@mkdir($dir)) return true; rmdir($dir); return false; } ?> ---- Server IP: 62.73.196.231 Probable Submitter: 82.59.132.59 ---- Manual Page -- http://www.php.net/manual/en/function.is-dir.php Edit -- https://master.php.net/note/edit/75248 Del: integrated -- https://master.php.net/note/delete/75248/integrated Del: useless -- https://master.php.net/note/delete/75248/useless Del: bad code -- https://master.php.net/note/delete/75248/bad+code Del: spam -- https://master.php.net/note/delete/75248/spam Del: non-english -- https://master.php.net/note/delete/75248/non-english Del: in docs -- https://master.php.net/note/delete/75248/in+docs Del: other reasons-- https://master.php.net/note/delete/75248 Reject -- https://master.php.net/note/reject/75248 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#126717) next »