Saved Bookmarks
| 1. |
Solve : FTP: using ls to write a directory listing locally? |
|
Answer» NOT SURE if I'm in the correct forum.. but here goes.... I am connecting to a SECURE FTP site daily to SEND a file to a Vendor. Here is my script: open ip.address.of.vendor usernamepassword cd uploads put D:\folder\myfolder\*.csv quit this works perfect!!! what I am trying to do is add the LS command to write a remote directory listing locally. This is the only way I can think of to actually check to see if my file was successfully transmitted. I just want to add an ls command after my put command and PULL a directory listing back to my local machine.. can anyone help with the syntax??? Dunno if this helps I think you use dir in the local DOS ftp PROGRAM to cause an ls on the remote Unix machine to be written locally. On this page http://rotterdam.ics.uci.edu/info/DosFtp.htm it says Quote Using FTP in MS-DOS:I don't know of a way to do what you want in one step. I think you have to do it in 2 steps. For example, if your current batch is called UPLOADFILES.BAT and your FTP command file is called UPLOADFILES.FTP, you can make a new command file named LISTFILES.FTP like this: UPLOADFILES.BAT Code: [Select]ftp -s:uploadfiles.ftp ftp -v -s:listfiles.ftp >filelist.txt LISTFILES.FTP Code: [Select]open ip.address.of.vendor username password cd uploads ls quit Then you can parse your FILELIST.TXT Thanks GuruGary. That is what I was looking for! I get back a directory listing from the remote end written to a .txt file - I don't get a date/time stamp on the file, but the filename contains the current date, so that should be good enough. Thank you for your help!If you want the timestamps, try replacing the "ls" command in the LISTFILES.FTP with "dir". |
|