gd_getfile

Retrieves a remote file using GridFTP.

 

Syntax

gd_getfile(host,remotefile,localfile,filetype='ASCII')

 

Description

This command retrieves a file from a remote server using GridFTP. The user must specify the remote file location on a remote server and the local destination for the file. The user can also specify the file type. 

 

gd_getfile(host,remotefile,localfile) transfers the remote ASCII file remotefile from the machine host. The file is saved to the path and file specified by the string localfile

 

gd_getfile(host,remotefile,localfile,filetype) as above except the string filetype sets the file transfer type. When filetype = 'ASCII' the file transfer type will be ASCII (this is the default setting), alternatively when filetype = 'binary' the file transfer type is set to binary.

 

Examples

The following command copies the file 'data2.dat' from the users home directory on the remote host 'server' to the local file 'C:/data1.dat'. The file is transferred as a binary file type.

 

from gdcompute import *

gd_getfile('server.domain.com','data2.dat','C:/data1.dat', 'binary')

 

This example behaves as above except the file is copied from the subdirectory 'tmp' in the users home directory.

 

gd_getfile('server.domain.com','tmp/data2.dat','C:/data1.dat', 'binary')

 

The following example is similar to the first example except the file is copied from the subdirectory 'tmp' of the root directory on the remote machine.

 

gd_getfile('server.domain.com','/tmp/data2.dat','C:/data1.dat','binary')

 

Notes

A valid proxy certificate is required to use GridFTP. Suitable credentials may be required to transfer files from a remote server.

 

See also

gd_putfile, gd_createproxy

 



gd_fileexists

contents

gd_jobkill

Copyright © 2005, The Geodise Project, University of Southampton