Sure. Get the HTML with lwp, read the hrefs and srcs out of it with HTML::Parser (or friends), and then chop off the part after the last /. Lather, recruse, repeat. This, of course, wont catch directories that dont have anything in them used, but exist anyway, and directories that have only their index.html linked to with the implicit directory-name-without-trailing-slash redirect.
If you want somthing thats a little less of an ugly hack, hope you can use FTP to get the content.
We are using here a powerful strategy of synthesis: wishful thinking. -- The Wizard Book
PS -- sorry about the bad contractions, but the quote key on this keyboard is broken.
| [reply] |
As long as you are talking about the directory structure underneath the DocumentRoot, I believe it depends on the directory permissions on the server (if they are set a certain way, you can request the directory -- e.g. http://foo.com/images). Look into wget, LWP::(Simple|RobotUA) (haven't used either for what you want to do, and haven't looked into it much).
redmist
Purple Monkey Dishwasher
| [reply] [d/l] |
No, this is not possible without a login on that server, or some other form of cooperation from the server. | [reply] |
Couple of different options:
Expect.pm, with a raw telnet into the box. Not real secure for the remote user, IMHO.
OR
Write a cgi for the remote box that basically does this:
print "Content-type:text/html\n\n";
opendir (D,".") || die "$!";
print join ("\n",(sort {$a cmp $b} grep !/^\.\.?$|$0/, readdir D));
close(D);
Put the CGI on the remote machine, and just parse the HTTP response into an array to get the dirlisting.
If this needs to be recursive on the remote machine, checkout File::Find. | [reply] [d/l] |
Ha! :-) ummm, nope, I don't believe this would be possible without logging in... I suppose it could be made to be possible, but they might do nasty things to the sysadmin in charge who let something like that be possible. Pummel into unconsciousness with an organic carrot comes to mind.
webadept | [reply] |