Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: partial patch #346

Closed
JeWe37 opened this issue Jun 22, 2023 · 2 comments
Closed

Feature request: partial patch #346

JeWe37 opened this issue Jun 22, 2023 · 2 comments

Comments

@JeWe37
Copy link

JeWe37 commented Jun 22, 2023

I would like to be able to read only a specific section (offset, length) of a patched file, but with the current APIs I need to patch the entire file to do that, which introduces a lot of latency and/or requires a lot of space-inefficient caching.

@sisong
Copy link
Owner

sisong commented Jun 24, 2023

HDiffPatch does not support partial patch now;
You may need to modify and implement it yourself;
From your requirements description, it's like in-place update? refer discussion #36 .

@JeWe37
Copy link
Author

JeWe37 commented Jun 24, 2023

Assuming the translation is correct that seems so

I have done a bit of experimenting with this myself and getting a sketch implemented for the old APIs(patch(...)) was relatively easy, but I can't say I understand the code of the new APIs well enough to do the same for those. The algorithm I came up with was essentially the same as is outlined in that issue, basically just have a sorted list for the covers and run length encoding sequences, then whenever a specific segment is read do a binary search for each and apply the values till the end of the range.

I'll close this as a duplicate.

@JeWe37 JeWe37 closed this as completed Jun 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants