Topic "unable to delete local files"

Author Message
Nishant Shah


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.

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27106
Location: Prague, Czechia
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:
It employs mechanisms you need for implementation.

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License