开发者

How can I save text diffs?

This is language agnostic (but I am using PHP and MySQL if it helps). How can I save MASSIVE amounts of text data efficiently? Google Docs, for example, autosaves a document and saves every version of that document. I imagine they don't store EACH version as that would开发者_C百科 be super huge. They probably just store a series of DIFFS.

Any ideas?


RCS? http://www.gnu.org/software/rcs/


I think you've got it. Storing the current version of a file and diffs for revisions is a good way to go. You always have the current version handy, and you only need to apply the diffs when you display or revert to an old version. There's the command line diff and patch, and there's a variety of "difflib" libraries to choose from if you want to avoid the filesystem altogether.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜