mirror of
https://github.com/dlang/phobos.git
synced 2025-05-14 17:05:58 +03:00
Merge pull request #3412 from Dicebot/curl-file-import
[REG] Add missing std.stdio import to std.net.curl
This commit is contained in:
commit
f830db2b48
1 changed files with 2 additions and 0 deletions
|
@ -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; };
|
||||
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue