PHP, C++, and LAN

From: Date: Wed, 01 Aug 2001 14:32:41 +0000
Subject: PHP, C++, and LAN
Groups: php.general 
Request: Send a blank email to php-general+get-60656@lists.php.net to get a copy of this message
Hello, I'm writing some PHP scripts that will only be used over our local Windows NT/2000 network. I've written a directory browser in PHP, but that only sees the server's local directories/files whereas I would also like to be able to see shared network directories. Since the PHP directory functions don't allow network connections (i.e. //harp/graphics/) I decided that a good workaround would be to write a C++ program that listed the directories and files (like dir or ls if you're on Unix, and I can't get dir to work through a PHP exec command), and then I would parse the output in PHP. I've since written two different C++ programs to do this, one using findfirst and findnext, and other using opendir and readdir. They both work by specifying the directory to be listed after the program (i.e. "listFiles.exe d:/" or "listFiles.exe //harp/graphics/"). Both of these programs work just as expected from the command prompt, working with both directories local to the server and those on a shared network drive. However, both of these programs fail using any PHP system command (exec, passthru, system) when specifying a network drive as the arguement, although both work when a server's local directory is given. For some reason it can no longer read the network drive when run through PHP. I've double and triple checked the arguements passed, and they command issused is exactly that given at the command prompt. I've even tried changing the current working directory in the C++ program and to no avail. Does anybody have any insight, or perhaps another route down which to travel? I will happily provide PHP and/or C++ code for what I'm doing. Thank you, Keith Jeffery jeff2619@uidaho.edu

« previous php.general (#60656) next »