Re: [Vala] Downloading a file from the internet to some directory.



On Sun, Sep 27, 2009 at 09:43:46AM +0200, Frederik wrote:
Arkadi Viner wrote:
Hello every body.

My program needs to download some file from the internet each time it
starts,
how to accomplish that mission?

Is there a gtk librery to do it or i have to use the webkit library?

Thanks.

Hi,

--------------------------------------------------------------------
void main () {
      var src = File.new_for_uri ("http://download.gnome.org/sources/vala/0.7/vala-0.7.6.tar.bz2";);
      var dst = File.new_for_path ("vala-0.7.6.tar.bz2");
      try {
              src.copy (dst, FileCopyFlags.NONE, null, null);
      } catch (Error e) {
              stderr.printf ("%s\n", e.message);
      }
}

Doesn't this require gvfsd-http? I am also looking at file downloads
for APT2 and everytime I use a http url, it starts gvfsd-http. And
installing all the gvfs backends is not really acceptable for APT2.


-- 
Julian Andres Klode  - Debian Developer, Ubuntu Member

See http://wiki.debian.org/JulianAndresKlode and http://jak-linux.org/.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]