W
W
waltaki2020-06-07 11:14:46
Algorithms
waltaki, 2020-06-07 11:14:46

What algorithm would you recommend for finding changes in the text?

I have web ftp, and now when I save a file, I just send all the new content and update the entire file on the server. This is very inefficient.
Can you tell me the best way to implement this?
For example, like git, very convenient.
Alternatively, we need an algorithm that will find changes in the source text, and only send them to the server, with the position and already on the server, then I will replace the text with the positions.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Armenian Radio, 2020-06-07
@gbg

It's called rsync

V
Vladimir Korotenko, 2020-06-07
@firedragon

https://ru.m.wikipedia.org/wiki/Team_(template_pr... try to implement based on this pattern, we made a board for collaborative editing of project documentation

X
xmoonlight, 2020-06-09
@xmoonlight

The algorithm is simple: a "tree" of chunks (if it's code) and a "chain" of chunks (if it's NOT code).
1. Form two unified "trees" of dependent parts of the code for the old and new files in the form of chunks (blocks).
2. Take away only the changed "branches" of the common unified "tree".
Of course, all this will have to be implemented from scratch on our own.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question