Previous SAXO Documentation Assistant: Overview Next

ToBeReviewed/LECTURE/

read_ftp.pro

READ_FTP, remote_host [, files] [, directory] [,/FILE] [,DATA=variable] [,USER=string] [,PASS=string] [,/PTR]

Routine summary

ftp_post, u, cmd, res, out=out, count=count
ftp_parse_pasv, text, host, port
read_ftp, site, files, dir, port, data=data, file=file, user=user, pass=pass, ptr=ptr

 

ftp_post

ftp_post, u, cmd, res, out=out, count=count

Parameters

u       

cmd       

res       

Keywords

out       

count       

Upon return, the number of elements in the result set. This is only important when the result set is the empty set, in which case COUNT is set to zero.

Examples


    

Version history

Version

$Id: read_ftp.pro 325 2007-12-06 10:04:53Z pinsard $

History

Known issues

Restrictions

 


ftp_parse_pasv

ftp_parse_pasv, text, host, port

Parameters

text       

ASCII text string containing the message.

host       

port       

Examples


    

Version history

Version

$Id: read_ftp.pro 325 2007-12-06 10:04:53Z pinsard $

History

Known issues

Restrictions

 


read_ftp

read_ftp, site, files, dir, port, data=data, file=file, user=user, pass=pass, ptr=ptr

Parameters

site       

files       

A single filename or an array of filenames to be retrieved.

dir       

Remote directory where the files reside on the ftp server

port       

Keywords

data       

Set this to a named variable that will contain either a byte array or an array of pointers to byte arrays with the transferred data. If there is more than one file, an array of pointers is returned, one for each file. Note that when downloading large files using /FILE instead will require much less memory since the entire file is not stored in a variable in that case.

file       

Set this keyword to make a local copy of the file to be transferred. The local file will have the same name as the remote file and will be placed in the current working directory.

user        default: anonymous

Specify user name to connect to server with.

pass        default: test@test.com

Specify password to use when connecting.

ptr       

Set this keyword to return an array of pointers even when there is only one file.

Examples

 1) Retrieve and print the contents of ftp://ftp.rsinc.com/pub/gzip/README.GZIP:
   IDL> READ_FTP, 'ftp://ftp.rsinc.com/pub/gzip/README.GZIP', DATA=data
   IDL> help, data
          DATA            BYTE      = Array[2134]
   IDL> print, string(data)
     ------------------------------------------------------------------------------
     README file: Research Systems Anonymous FTP site (ftp.rsinc.com)
                   pub directory
                   gzip directory
   ------------------------------------------------------------------------------
   ...

 2) Retrieve some files from podaac.jpl.nasa.gov and store the files
    in the current working directory:

    IDL> files = string(lindgen(10)+50,format='(%"MGB370.%3.3d.gz")')
    IDL> READ_FTP, 'podaac.jpl.nasa.gov', files,  $
    IDL>       'pub/sea_surface_height/topex_poseidon/mgdrb/data/MGB_370', /FILE
    IDL> spawn,'dir MGB*',/log_output
     Volume in drive C is Local Disk
     Volume Serial Number is 34CE-24DF

     Directory of C:testtest0307

    07/28/2003  11:58a             362,167 MGB370.050.gz
    07/28/2003  11:58a             333,005 MGB370.051.gz
    07/28/2003  11:58a             310,287 MGB370.052.gz
    07/28/2003  11:58a             358,771 MGB370.053.gz
    07/28/2003  11:59a             387,282 MGB370.054.gz
    07/28/2003  11:59a             361,633 MGB370.055.gz
    07/28/2003  11:59a             383,075 MGB370.056.gz
    07/28/2003  11:59a             365,844 MGB370.057.gz
    07/28/2003  11:59a             383,918 MGB370.058.gz
    07/28/2003  12:00p             372,712 MGB370.059.gz
                  10 File(s)      3,618,694 bytes

  These compressed files can consequently be opened with OPENR and the
   /COMPRESSED keyword.

    

Version history

Version

$Id: read_ftp.pro 325 2007-12-06 10:04:53Z pinsard $

History

Known issues

Todo items

seb: que fait-on de "syntax" au debut du header? give examples with date in year 0 (should not exists but may happen)

 


  Produced by IDLdoc 2.0.