Question

I'm using Ararat Synapse for Delphi, so if there's a way to set such a mode (or get ls results to a stringlist) I can do it with code. I've looked at the unit code and the dokuwiki and haven't found anything conclusive.

But if there's an FTP command or setting I could use to prevent overwrites (resulting in a GET or PUT not being performed) it would save me a lot of time.

The only way using normal FTP commands that I see right now is to put each file in a folder. Before creating the folder I try to CD to it and PWD the current directory.

In other words, a sort of "sync folders", but only for a specific list of file names.

Was it helpful?

Solution

There is no such FTP command for what you are asking. You have to implement such logic in your own code. If a file already exists in the destination folder, simply don't issue a GET or PUT command. Use Delphi's FileExists() function to check if a local file exists. Use the FTP LIST, MLST, and/or SIZE command(s) to check if a remote file exists.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top