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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP file test

Status
Not open for further replies.

Mag0007

MIS
Feb 15, 2005
829
US
Is there a way to test if a file exists on a remote system?

I have its ftp username/password.

 
I guess you could try a get on the file from ftp and if it fails, you know the file isn't there.
 
i would think there is a ftp logic command or something...
 
you might want to try

modtime <filename>

gives timestamp of a file

not in all FTP clients/servers I think

HTH,

p5wizard
 
it seems I can use "nlist" which is a default on almost all ftp clients. I am using a standard UNIX ftp client. (HP-UX)

didn't think this was going to be this hard :)
 
We do it by writing the output of the ftp command to a file and then grepping that file for specific 'success' or 'failure' messages, based on the message returned from a get command. Simple enough to set up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top