unable to delete local files

Advertisement

Nishant Shah
Guest

unable to delete local files

Dear All,

i am trying to sync remote files with the local files (the newer files are in the remote ftp). my aim is to download only newer files from the ftp so i am using the synchronize local -delete command (i already have the lcd and remote dir set). what i see is that the newer files are downloaded but the old file still remains in the local dir. please note that the files in the remote dir are incremental and hence will contain the older file also.

Nishant.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,517
Location:
Prague, Czechia

Re: unable to delete local files

WinSCP won't obviously remove exiting local files if they are also present in the source remote directory. That's a point of synchronization.

If you want to download all files not present in the local directory and then delete all previous local files, you have to implement this on your own.

You can use synchronization and then iterate all local files, deleting those that were not synchronized.

I suggest you use Session.SynchronizeDirectories from WinSCP .NET assembly from a PowerShell script..

See this example:
https://winscp.net/eng/docs/library_example_delete_after_successful_download
It employs mechanisms you need for implementation.

Reply with quote

Advertisement

You can post new topics in this forum