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

[Issue #23] Allow larger than 2GB files to be read. #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwkblades
Copy link

read and write return a signed int, meaning that they can only read
up to 2 billion bytes (2GB) at a time. bsdiff and bspatch were expecting
the entire file to be read (or written, respectively) in a single call
to read or write, which is only possible if they are less than 2GB
in size. There are also other times in which a single function call
would be inadequate for IO, for instance in the case where a device is
busy. The fix for this was to place the functions in a loop and continue
as long as at least 1 byte was transferred (in or out). If an error, or 0
return value, comes back from the transfer, break out of the loop and
return the total number of bytes that had been transferred up to that
point.

Updated the .gitignore file to ignore vim swap files, as well as the
autoconf (generated) files and the executables.

`read` and `write` return a signed int, meaning that they can only read
up to 2 billion bytes (2GB) at a time. bsdiff and bspatch were expecting
the entire file to be read (or written, respectively) in a single call
to `read` or `write`, which is only possible if they are less than 2GB
in size. There are also other times in which a single function call
would be inadequate for IO, for instance in the case where a device is
busy. The fix for this was to place the functions in a loop and continue
as long as at least 1 byte was transferred (in or out). If an error, or 0
return value, comes back from the transfer, break out of the loop and
return the total number of bytes that had been transferred up to that
point.

Updated the .gitignore file to ignore vim swap files, as well as the
autoconf (generated) files and the executables.
gaetandezeiraud added a commit to gaetandezeiraud/bsdiff-node that referenced this pull request Sep 27, 2019
@gaetandezeiraud
Copy link

Thanks for the Pull Request. I integrated it into the project bsdiff-nodejs (https://github.com/Exoway/bsdiff-nodejs).

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

Successfully merging this pull request may close these issues.

None yet

2 participants