How to perform copies with LWPng

Blair Zajac (blair@gps.caltech.edu)
Tue, 5 May 1998 10:36:35 -0700 (PDT)


Hi,

I'm developing a code that downloads GPS data from a large number of
computers and moves them to a series of archives.  The archive will
either be on a remote anonymous FTP server or on a local file.  I'd
like to have a function like

  urlcp('ftp://comp1/pub/data1.dat', 'file:/archive/data/data1.dat');
  urlcp('ftp://comp1/pub/data2.dat', 'ftp://archive.com/data/data2.dat');
  urlcp('http://www.comp1/data/data3.dat', file:/tmp/data3.dat');

Basically, urlcp could take an arbitrary URL and copy the file to another
URL.  I don't want to have to worry about the type of data source or
final location of the data, this would be taken by LWPng.  I'm going to
write this using LWPng so multiple copies can be performed at the same
time.  I saw a post from Gisle where the data from the first URL is read
in as chunks.  However, I don't know how to post a large file to an URL.
Presumably, the only URL's allowed to transfer data to would be ftp: or
file:.

I looked through the LWPng documentation, but it wasn't clear to me how
to write a large file using LWPng.  Could somebody post some code showing
how this is done?

Thanks,
Blair Zajac
--
Dr. Blair Zajac			Division of Geological and Planetary Sciences
blair@gps.caltech.edu		California Institute of Technology
(626) 583-6729, FAX: 583-7827	252-21, Pasadena, CA 91125