开发者

FTP - command or setting to set "never overwrite" for a whole session

开发者 https://www.devze.com 2023-03-31 17:24 出处:网络
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 fou

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 th开发者_运维百科e 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消