Topic "Synchronize-question regarding odd setup"

Author Message



I have a somewhat odd need, that I'm not sure is supported - I hope you can tell me if it is:

I need to do a syncronize from ftp to local via a C# script. I have 2 local folders: Download and Archive. I want to look at contents of Archive to determine which files are downloaded from the ftp, but I want to place the files in the Download-folder. A regular Synchronize would obviously look at contents of Archive and update it with new files - this is not what I need.

I'm running some SSIS packages which move files from Download to Archive when they are loaded, and I don't want to re-download them afterwards. Due to a very large amount of files, I don't want to keep all the files in the Download-folder either, since I'm looping through files located in this folder in various SSIS-packages.

Is the above setup possible through some sneaky FileMask or some other method?

Thanks for any input!

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27086
Location: Prague, Czechia
Use a method Session.SynchronizeDirectories from WinSCP .NET assembly.

Do a regular synchronization against the "Archive" folder.

The method returns SynchronizationResult class that contains a list of downloaded (synchronized) files.

Iterate the list and move the downloaded files to "Download" folder.

See also:


Perfect - Thank you!

SynchronizationResult is exactly what I needed (and hadn't found).

Seems to work like a charm with the testing I've done so far.


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