Apr 14, 2003 #1 BB101 Programmer Joined May 23, 2001 Messages 337 Location GB How can I get a list of drives on the server from PHP. I know I can do it with a filesystem object, but I'd like to avoid com if at all possible! Thanks --BB
How can I get a list of drives on the server from PHP. I know I can do it with a filesystem object, but I'd like to avoid com if at all possible! Thanks --BB
Apr 14, 2003 #2 sleipnir214 Programmer Joined May 6, 2002 Messages 15,350 Location US Going with an OS-specific solution like COM may be the only way to do it. PHP is developed on a unix-like OS and ported to Win32. Unix-like OSes do not support the quaint idea of drive letters. Want the best answers? Ask the best questions: http://www.catb.org/~esr/faqs/smart-questions.htmlTANSTAAFL! Upvote 0 Downvote
Going with an OS-specific solution like COM may be the only way to do it. PHP is developed on a unix-like OS and ported to Win32. Unix-like OSes do not support the quaint idea of drive letters. Want the best answers? Ask the best questions: http://www.catb.org/~esr/faqs/smart-questions.htmlTANSTAAFL!
Apr 14, 2003 Thread starter #3 BB101 Programmer Joined May 23, 2001 Messages 337 Location GB I did expect to see one on php.net though, and I did end up using a com call to scripting.filesystem ( Anyway, for anyone who cares: $fso = new COM("Scripting.FileSystemObject" $drives = $fso->Drives; $drives = $drives->Next($drives->Count); $first = true; foreach ($drives as $drive) { echo $drive->DriveLetter."<br>"; } All the other drive properties from fso can be used too. --BB Upvote 0 Downvote
I did expect to see one on php.net though, and I did end up using a com call to scripting.filesystem ( Anyway, for anyone who cares: $fso = new COM("Scripting.FileSystemObject" $drives = $fso->Drives; $drives = $drives->Next($drives->Count); $first = true; foreach ($drives as $drive) { echo $drive->DriveLetter."<br>"; } All the other drive properties from fso can be used too. --BB