0

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.

Thom A
  • 88,727
  • 11
  • 45
  • 75
Henrik Erlandsson
  • 3,797
  • 5
  • 43
  • 63

1 Answers1

3

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.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • I followed your advice and LISTed out existing files for a correct sync of those not on the list. This is now part of a pretty complex system that has been running well for months at our customer's. Thanks! – Henrik Erlandsson Nov 15 '11 at 09:57