note 87454 added to function.opendir

From: Date: Fri, 05 Dec 2008 17:36:45 +0000
Subject: note 87454 added to function.opendir
Groups: php.notes 
Request: Send a blank email to php-notes+get-147720@lists.php.net to get a copy of this message
Having spent an hour or so trying to get a complete list of files from a network share on Windows, I've given up (Apache 2.2 Win32, WinXP, PHP5 -> Windows 2000 R2). Trying to use a mapped drive letter gives me an error and trying to use the UNC path works but is dog slow (it takes a couple of minutes to open and readdir() a directory with a couple of hundred files). Using this code is fast and instant (you'll have to chop up the output yourself but so be it!) $out = dir $dir /B /S; If you don't need recursive subdirectories remove the /S from the command - for more details run 'dir /?' on Windows. Hope this helps somebody in a similar fix! ---- Server IP: 92.48.74.199 Probable Submitter: 92.235.228.207 ---- Manual Page -- http://www.php.net/manual/en/function.opendir.php Edit -- https://master.php.net/note/edit/87454 Del: integrated -- https://master.php.net/note/delete/87454/integrated Del: useless -- https://master.php.net/note/delete/87454/useless Del: bad code -- https://master.php.net/note/delete/87454/bad+code Del: spam -- https://master.php.net/note/delete/87454/spam Del: non-english -- https://master.php.net/note/delete/87454/non-english Del: in docs -- https://master.php.net/note/delete/87454/in+docs Del: other reasons-- https://master.php.net/note/delete/87454 Reject -- https://master.php.net/note/reject/87454 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#147720) next »