pro ftp_from_facom,remotefile,localfile,host,user_password ;+ ; NAME: ; ftp_from_facom ; PURPOSE: ; Transfer files from the Facom Mainframe using FTP ; CALLING SEQUENCE: ; ftp_from_facom,remotefile,localfile,host,user_password ; HISTORY: ; 97/08/05 TSakurai, based on Jim Lemen's facom_ftp ;- temp_file = '~/script_ftp' temp_file2= '~/script_ftp.01' file_delete,[temp_file,temp_file2] openw,lun,temp_file,/get_lun printf,lun,'#! /bin/csh' printf,lun,'set host = "',strtrim(host,2),'"' printf,lun,'echo "open $host" > '+temp_file2 printf,lun,'echo "user ',strtrim(user_password),'" >> '+temp_file2 printf,lun,'echo "get ',strtrim(remotefile,2),' ',localfile,' " >> '+temp_file2,format='(5a)' printf,lun,'echo "close" >> '+temp_file2 printf,lun,'echo "bye" >> '+temp_file2 printf,lun,'ftp -n < '+temp_file2 free_lun,lun spawn,'chmod +x '+temp_file spawn,'source '+temp_file file_delete, [temp_file, temp_file2] end