-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian Keck wrote:
> Hello,
> 
> If you do
> 
>         wget http://www.ifixit.com/Guide/First-Look/iPhone3G
> 
> then you get an HTML file called iPhone3G.
> 
> But if you do
> 
>         wget -p http://www.ifixit.com/Guide/First-Look/iPhone3G
> 
> then you get a directory called iPhone3G.  
> 
> This makes sense if you look at the links in the HTML file, like
> 
>     /Guide/First-Look/iPhone3G/images/3jYKHyIVrAHnG4Br-standard.jpg
> 
> But of course I want both.  Is there a way of getting wget -p to do
> something clever, like renaming the HTML file?  I've looked through
> wget(1) & /usr/share/doc/wget & the comments in the 1.10.2 source
> without seeing anything relevant.

That strikes me as not quite right. If Wget sees
http://www.ifixit.com/Guide/First-Look/iPhone3G, and it's not redirected
to http://www.ifixit.com/Guide/First-Look/iPhone3G/, then Wget will use
a file name. What's more, if it later sees it with the slash, it will
fail to create a directory at all, since the file already exists with
that pathname.

I'm not sure what you mean by "I want both". You can't possibly have a
regular file named iPhone3G, and another file named iPhone3G/images/...
it can't be both a file and a directory at once.

If you specify the link with a trailing slash, then Wget will realize
iPhone3G is a directory, and will store the file it finds there as
iPhone3G/index.html. You're out of luck, though, if some links refer to
it with, and some without, the trailing slash, with a server that
doesn't redirect to the slash version (like Apache does).

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer,
and GNU Wget Project Maintainer.
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIgiPA7M8hyUobTrERAmq8AJ96TyBcrdI0YB06Z2tODRCMSI22AgCggESe
jgXOMQ+uNMupbgq0vJZByv0=
=jzGB
-----END PGP SIGNATURE-----

Reply via email to