Skip to content

Commit

Permalink
Merge pull request #3412 from Dicebot/curl-file-import
Browse files Browse the repository at this point in the history
[REG] Add missing std.stdio import to std.net.curl
  • Loading branch information
CyberShadow committed Jun 17, 2015
2 parents f012f7d + ff14539 commit f830db2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions std/net/curl.d
Expand Up @@ -289,6 +289,7 @@ void download(Conn = AutoProtocol)(const(char)[] url, string saveToPath, Conn co
{
static if (is(Conn : HTTP) || is(Conn : FTP))
{
import std.stdio : File;
conn.url = url;
auto f = File(saveToPath, "w");
conn.onReceive = (ubyte[] data) { f.write(data); return data.length; };
Expand All @@ -309,6 +310,7 @@ unittest
// No anonymous DigitalMars FTP access as of 2015
//download("ftp.digitalmars.com/sieve.ds", buildPath(tempDir(), "downloaded-ftp-file"));
download("d-lang.appspot.com/testUrl1", buildPath(tempDir(), "downloaded-http-file"));
download!(HTTP)("d-lang.appspot.com/testUrl1", buildPath(tempDir(), "downloaded-http-file"));
}

/** Upload file from local files system using the HTTP or FTP protocol.
Expand Down

0 comments on commit f830db2

Please sign in to comment.