note 113890 added to function.opendir

From: Date: Fri, 13 Dec 2013 15:40:45 +0000
Subject: note 113890 added to function.opendir
Groups: php.notes 
Request: Send a blank email to php-notes+get-197926@lists.php.net to get a copy of this message
You can't rely on is_dir() and a permissions check to know whether opendir() will succeed. I'm working on a Windows system and accessing files on an OSX share. There are file/folder names with unsupported characters in them, (such as ">"), so opendir() fails with "the volume label syntax is incorrect." However, is_dir() will report - correctly - that it these are valid directories! Though for what it's worth, Windows can't get in there either. The ">" character existing in the folder name is a problem for both. Bottom line: you may need to test the result of opendir() before you go on to process it, even if you've checked permissions and is_dir() beforehand. ---- Server IP: 72.52.91.14 Probable Submitter: 72.52.91.14 ---- Manual Page -- http://php.net/manual/en/function.opendir.php Edit -- https://master.php.net/note/edit/113890 Del: integrated -- https://master.php.net/note/delete/113890/integrated Del: useless -- https://master.php.net/note/delete/113890/useless Del: bad code -- https://master.php.net/note/delete/113890/bad+code Del: spam -- https://master.php.net/note/delete/113890/spam Del: non-english -- https://master.php.net/note/delete/113890/non-english Del: in docs -- https://master.php.net/note/delete/113890/in+docs Del: other reasons-- https://master.php.net/note/delete/113890 Reject -- https://master.php.net/note/reject/113890 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#197926) next »