comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » idlneturl question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
idlneturl question [message #90474] Tue, 03 March 2015 21:07 Go to next message
Dae-Kyu Shin is currently offline  Dae-Kyu Shin
Messages: 25
Registered: February 2015
Junior Member
hi
can i get last modified time of ftp file using idlneturl object ?


for example in ubuntu

$ ftp spdf.gsfc.nasa.gov
Name : anonymous
ftp> cd pub/data/omni/omni_cdaweb/hro_5min/1981
ftp> modtime omni_hro_5min_19811201_v01.cdf

then i can see this information
"omni_hro_5min_19811201_v01.cdf 02/17/2014 07:39:28 GMT"

can i get this information using 'idlneturl' or another procedure??

thanks
Re: idlneturl question [message #90476 is a reply to message #90474] Wed, 04 March 2015 03:45 Go to previous messageGo to next message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
I have not found a way to look at file information using IDLnetURL without downloading the file first. With IDLnetURL, you have to perform a Get, then look at the response header. Below is an example of how to get the response header.


IDL> oURL = IDLnetURL()
% Loaded DLM: URL.
IDL> info = oURL -> Get(URL=' ftp://spdf.gsfc.nasa.gov/pub/data/omni/omni_cdaweb/hro_5min/ 1981/omni_hro_5min_19811201_v01.cdf')
IDL> oURL -> GetProperty, RESPONSE_HEADER=rh
IDL> print, rh
220-WARNING! This is a U.S. Government Computer
This U.S. Government computer is for authorized users only.
By accessing this system, you are consenting to complete monitoring with no expectation of privacy.
Unauthorized access or use may subject you to disciplinary action and criminal prosecution.
220 Welcome to our FTP Server
331 Anonymous login ok, send your complete email address as your password
230 Anonymous access granted, restrictions apply
257 "/" is the current directory
250 CWD command successful
250 CWD command successful
250 CWD command successful
250 CWD command successful
250 CWD command successful
250 CWD command successful
200 EPRT command successful
200 Type set to I
213 2128388
150 Opening BINARY mode data connection for omni_hro_5min_19811201_v01.cdf (2128388 bytes)
226 Transfer complete


Well, that was interesting...

Apparently NASA will not give you a meaningful response header. This is how I normally do it, though. There should be a "Last-Modified" field that you can look for to parse the information you want.


IDL> file = oURL -> Get(URL=' http://emfisis.physics.uiowa.edu/Flight/RBSP-A/L3/2013/02/02 /rbsp-a_magnetometer_4sec-geo_emfisis-L3_20130202_v1.3.2.cdf')
IDL> ourl -> GetProperty, RESPONSE_HEADER=rh
IDL> print, rh
HTTP/1.1 200 OK
Date: Wed, 04 Mar 2015 11:44:03 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Thu, 29 Jan 2015 21:26:19 GMT
ETag: "53c077a-f7fa2-50dd123904e55"
Accept-Ranges: bytes
Content-Length: 1015714
Content-Type: application/x-cdf
Re: idlneturl question [message #90596 is a reply to message #90476] Thu, 12 March 2015 14:17 Go to previous messageGo to next message
Dominic[2] is currently offline  Dominic[2]
Messages: 3
Registered: October 2014
Junior Member
Hi,

There is a way to read the response without downloading entire file. It involves interrupting the IDLnetURL GET request and returning after reading the response header. For example,

IDL> file=' http://emfisis.physics.uiowa.edu/Flight/RBSP-A/L3/2013/02/02 /rbsp-a_magnetometer_4sec-geo_emfisis-L3_20130202_v1.3.2.cdf'

IDL> header=webhead(file)

IDL> print,header
HTTP/1.1 200 OK
Date: Thu, 12 Mar 2015 21:12:22 GMT
Server: Apache/2.2.22 (Ubuntu)
Last-Modified: Thu, 29 Jan 2015 21:26:19 GMT
ETag: "53c077a-f7fa2-50dd123904e55"
Accept-Ranges: bytes
Content-Length: 1015714
Content-Type: application/x-cdf


Check out: http://www.heliodocs.com/wordpress/?p=1

where you can download webhead.pro. I have had some success using it with FTP URL's.

Dominic
Re: idlneturl question [message #90609 is a reply to message #90596] Sat, 14 March 2015 05:48 Go to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
> There is a way to read the response without downloading entire file. It involves interrupting the IDLnetURL GET request and returning after reading the response header.


This is great! Thanks for sharing!
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: X Windows display
Next Topic: SPAWN error question

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:27:41 PDT 2025

Total time taken to generate the page: 0.00669 seconds