Upload changes made to the file (FTP)
I'm making some kind of FTP Uploader Client.开发者_JAVA技巧 I can upload files, but I don't know how to upload changes made to the file. What I mean when saying changes is not that file was renamed, but when its content has changed. For example I have a *.rar file (large enough) with some files in it. When I add some new file, I don't want the whole *.rar to be uploaded, just the part that changed. I know about WebRequestMethods.Ftp.AppendFile
but it appends only at the end of file, and what if changes where applied in the middle? I'll get a junk file...
I've read about "binary diff" & seen a couple of client that make changes directly on the server (FileZilla, Direct FTP, ALFTP)
Actually if files in your rar archive are changed - you should rebuild and re upload whole archive.
FTP share not saving history of what files changed, or renamed. So, the only solution is:
- Save list of files in some kind of xml on client application.
- When you retrieve list of files from ftp - compare if with list of files in your history xml.
These two steps won't help you to find what files were renamed, but will provide you with information of what files removed or added.
Comparing if file were changed can be done by saving in your history file size of them. If you need more precise check you can generate CRC for files:
http://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net
but generating of the crc is a very long task.
精彩评论