note 46340 deleted from ref.filesystem by felipe
| From: | felipe@php.net | Date: | Mon, 10 Dec 2007 17:57:16 +0000 |
| Subject: | note 46340 deleted from ref.filesystem by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133227@lists.php.net to get a copy of this message | ||
Note Submitter: m2pc (at) hotmail.com
----
After searching all over the place to find a function to do what I wanted, I wrote the following:
/*
** Returns an array of valid drives on the system (a:, b:, etc.)
*/
function getSystemDrives () {
// Initialize
$aResult = Array ();
// Loop from A-Z and try opening the root dir
for ($letter = 'A'; $letter <= 'Z'; $letter ++) {
if (is_dir ($letter . ":"))
$aResult [] = $letter . ":";
}
// Return results
return ($aResult);
}
It simply returns an array of valid drives as seen from the server (A:, B:, etc.). This obviously
is targeted to Win32 installations only.