Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP list to download 1

Status
Not open for further replies.

aixmurderer

IS-IT--Management
Nov 28, 2000
603
NZ
Hi all

I need to list the files on a remote FTP server, move them to a working directory on the remote server, download them, and finally rename them on the remote server. Quite an ask...

My idea was to read the remote file list into a local file, then loop through the local file and do what's required for each file name in the list.

The problem I have is with writing the remote list of files to a local file (e.g. ls > file.list), the local file is created but is empty. Tried "ls", "dir", "nlist", all with the same result.

What am I doing wrong?

IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
 
From my ftp man page:
dir [ remote-directory ] [ local-file ]
Print a listing of the directory contents in the
directory, remote-directory, optionally placing the output
in local-file. If interactive prompting is on, ftp will
prompt the user to verify that the last argument is the
target local file for receiving dir output.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks mate, should have read the man pages myself instead of trying to figure it out from the ftp help option.

Used nlist in the end, gives only the file names which is all I require.

IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top