Re: connecting to a server to retrieve data (optimizing) [message #41805] |
Sun, 28 November 2004 05:59 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
nunoragil@yahoo.com (Nuno Gil) writes:
> Hi listers,
>
> I'm fetching some data from the web with the following routine. This
> does the trick but it gets very slow, for it reads the data on the
> server and writes it localy bit by bit in a loop.
> Does anyone knows if it is possible to send the request and simply get
> the entire data in one turn?
Yes, read a byte array instead of a scalar byte. You choose the size
of the array you want to read, and if there is less data available,
then IDL will only read that much. The number of bytes read is
returned in the TRANSFER_COUNT keyword. You can then use that same
number to write the data to your file.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|