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

ftp script that copies files and deletes only those that were coped

Status
Not open for further replies.

cantina

MIS
Aug 30, 2004
14
US
Hello,

I have a script that will ftp into a server, download the files from a designated folder, and then delete the files from the FTP server. Problem is, i want the script to only delete the files that were copied, because there is a possibility of deleting files that were not copied.

Here is a snippet of the code:

cname="company name"
FTPX.LocalFolder = "d:\users\" & cname & "\incoming"
LOCALDIR = FTPX.LOCALFOLDER
FTPX.Download "/userdata/" & cname & "/INCOMING/*.*", LOCALDIR
FTPX.RemoteRemove "/userdata/" & cname & "/incoming/*.*"

I don't know how many files there will be or the names of the files beforehand. Is there anyway to copy the files from the FTP Server to the local server, verify the files were copied to the local server, and delete only the files that were verified on the FTP server?

Thanks for any insight.

Cantina
 
Cantina,

I am not sure if you are still having this problem. I was browsing for ftp info and came across this thread. I think I understand what your problem is. If possible what i would recommend you do is move the ftped information into a temp folder. Once you ar finished with the files then delete all files in the folder. I really hopes this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top