On Sun, 28 Dec 2014 06:14:09 +0000 Jack via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
> I'm trying to create a sort of "downloader" where it will > download multiple pages of "comics" which are in ".jpg" format. > Now the problem is, that when I used the "download() function": > >download(url, location); > Where: > url = direct link to the image > location = "/downloads/" ~ to!string(x) ~ ".jpg"; (x is the page > number) > > It would spew out an error code: > > std.stream.OpenException@std/stream.d(50): Cannot open or > > create file >'/downloads/1.jpg' > > I dug around to see that nothing but the documentation page has > an example for this, but unfortunately it was only for one file. > > So can anyone help me? > > Note: I can't get the url here since the url is a little bit > "NSFW" you are trying to write the file to "/download" directory, that obviously doesn't exist. `url` arg is the FULL url -- the one that you'll pass to wget to download the picture. and `location` is the DISK location of the resulting file (i.e. the file that will be created). as you are passing the absolute path for it, it starts searching from the root directory. now remove that pesky '/' at the start of the `location` and give us the link, as NSFW comics are specially good at sundays! ;-)
signature.asc
Description: PGP signature