Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

directory listing across network

Status
Not open for further replies.

goal

MIS
Apr 26, 2001
43
GB
Hi,

I'm trying to get a directory listing of some of your remote servers (writing several web based automation application for file checking). I can use the opendir() readdir() etc. functions perfectly OK on my local machine, and even on a network share mapped to a drive on the local machine, but when pointing it to a network path, it returns nothing.

Anyone know a way around this or another method for listing the contents of a directory in such a way that I can use the returned information to retrieve file info such as date/time/size etc. (I know there are ways to do this in php, but obviously I need the filenames first of all).

Any help appreciated.

Andy.
 
You can set your PHP server to access some other server and use that connection like any local (in the PHP server) directory.
I hope it works...
Unix was made by and for smart people.
 
I'm not sure what you mean by that. I can access any other machine with shares over the network, but I can't get PHP to give me any directory/file information on that share. I need to get a list of files available on that share by using PHP (and indeed the size of those files).

It may help if I said I'm running apache win32.

Thanks,
Andy.
 
How determined are you?

Unfortunately, PHP does not have the capability you're looking for (the ability to map and read Windows shares). You could, however, write a PHP DLL that dynamically mapped shares, read a directory structure or info on a particular file and returned it. Read this for more information: And this:

I'm sure the PHP/Open source community would be grateful seeing as how no one's done this yet (at least as far as I'm aware). Post it to if you decide to do it.

Hope this helps,

brendanc@icehouse.net
 
Not THAT determined - this was designed as a quick php script to help me with my work, not hinder me more! :)

I guess I could exec the 'net use' command and map a drive, then read it then remove it? but thats just a little more complication than I required. Funny thing is, commands such as diskfreespace() works on just the shares (no mapped drive needed) and yet these directory commands dont - strange.

Anyway, thanks for all your help.

Andy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top