Reputation: 2478
this is more of a question because I am experimenting with this.
All over the internet I see how you can update a .txt file. Well that is all good and well, but lets say I have a .doxc or even an .exe or even a .dll file.
If we make a minor change to a file, do we really have to replace(overwrite) the whole file?
Is it possible to "update" the file so that we don't use too mush data (over the internet).
What I am trying to achieve is to create a FTP client with a FileSystemWatcher. This will monitor a certain folder on the Computer. If anything changes in this folder (even sub directories) then it uploads, deletes, renames, or changes the file. But at the moment I am wondering if I have, lets say, a 20MB .exe file or whatever, if it is possible to change something in that .exe, instead of just overwriting the whole thing... thus, sparing some cap.
Upvotes: 0
Views: 885
Reputation: 46095
In general, it's possible to update the remote file only partially, but not in your case.
What would work: 1) track the file change using a filesystem filter driver, which gives you information about what parts of the file have been updated. 2) use the protocol which allows partial upload or remote modification of the file (eg. SFTP).
As for your scenario:
Step 1 is not possible with FileSystemWatcher. Step 2 is not possible with FTP protocol which doesn't support modification of file blocks.
Upvotes: 1
Reputation: 2495
Since your are experimenting, I can provide some pointers. But I dont know for sure if the below operations are just updates or replaced newly by the underlysing os calls
[Text][Offset][[operation]
[Mrs.Y][40][Delete]
then [Mr.X][40][Add]
Upvotes: 1
Reputation: 918
@Frederik - It would be possible if FTP supports an updating of resource like HTTP's PUT command. Try exploring that angle. Let us know if you find something.
Upvotes: 0
Reputation: 37
No it is not possible to only upload the changes to .exe file.we have to overwrite it.
Upvotes: 0