On Saturday, 20 May 2023 at 09:20:54 UTC, kdevel wrote:
What if the internet connection is not re-established within an
reasonable amount of time? What if the resource is no longer
available on the server (HTTP eror 404 [1])? If there is an
interactive user: Wouldn't it be better have the
On Friday, 19 May 2023 at 23:36:28 UTC, anonymouse wrote:
[...]
The reason I used a while loop was to detect loss of internet
connection and resume the process once the connection is
re-established.
What if the internet connection is not re-established within an
reasonable amount of time?
On Friday, 19 May 2023 at 12:40:29 UTC, Danny Arends wrote:
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote:
What am I doing wrong here?
[SNIP]
You're running the whole thing in a while(TRUE) loop,
recreating the curl object re-initiating the transfer and file
pointer, etc.
The
On Friday, 19 May 2023 at 12:28:20 UTC, kdevel wrote:
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote:
What am I doing wrong here?
[...]
curl.set(CurlOption.writedata, );
According to [1] this line must read
```
curl.set(CurlOption.writedata, cast (void *)
On Friday, 19 May 2023 at 12:28:20 UTC, kdevel wrote:
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote:
What am I doing wrong here?
[...]
curl.set(CurlOption.writedata, );
According to [1] this line must read
```
curl.set(CurlOption.writedata, cast (void *)
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote:
What am I doing wrong here?
```D
import std.net.curl: Curl, CurlOption, CurlException;
import std.file: exists;
import std.stdio: File, writefln;
import core.thread: Thread;
void downloadFile(string url, string filename)
{
while
On Friday, 19 May 2023 at 11:07:01 UTC, anonymouse wrote:
What am I doing wrong here?
[...]
curl.set(CurlOption.writedata, );
According to [1] this line must read
```
curl.set(CurlOption.writedata, cast (void *) fp.getFP());
```
[1]
What am I doing wrong here?
```D
import std.net.curl: Curl, CurlOption, CurlException;
import std.file: exists;
import std.stdio: File, writefln;
import core.thread: Thread;
void downloadFile(string url, string filename)
{
while (true) {
try {
File fp;
if