How to check for internet connectivity and download file?

Tyro Tyro
Sun Apr 26 22:58:49 PDT 2009


Unknown W. Brackets Wrote:

> Well, checking for internet connectivity is a tricky and 
> operating-specific thing.
> 
> Would you rather check for connectivity with a specific host?  I gather 
> that would be more than appropriate for what you're wanting.

This should do just fine. Afterall it would do no good if I have connectivity but cannot reach the intended host.

> Are you wanting to download over HTTP, or a different protocol?  If over 
> HTTP, there are a ton of libraries that may be useful to you, and 
> there's also building your own HTTP request (which is actually pretty 
> trivial.)

I'm trying to download over both FTP and HTTP. Not sure if the same process is applicable to both protocols but I'm assuming not. 

> If you're using Tango, it has classes in it for these things.

Unfortunately I haven't played with Tango many years now and got away from D1 as soon D2 forked back in 2007.

> -[Unknown]
> 
> 
> Tyro[a.c.edwards] wrote:
> > I've used Burton Radons' "urllib" in the past to get download files from the internet, however the library has atrophied and can no longer be used with DMD v2.029 (not how long it's been this way because I haven't tried to compile it since 2006).
> > 
> > I'm wondering if someone could point me to an example of how to check for internet connectivity and if available download the latest version of a given file.
> > 
> > Thanks in advance.
> > Andrew



More information about the Digitalmars-d-learn mailing list