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

Executable cannot compress large files #3

Closed
Dobatymo opened this issue May 20, 2019 · 2 comments
Closed

Executable cannot compress large files #3

Dobatymo opened this issue May 20, 2019 · 2 comments

Comments

@Dobatymo
Copy link

Dobatymo commented May 20, 2019

Version: 1.0.6-win
Neither the x64 nor the x86 version managed to compress a 4.5 GB file.

bzip2: Input file large.file is not a normal file.

Small testfiles (few KB) worked.

@philr philr closed this as completed in c0ee33a May 21, 2019
@philr
Copy link
Owner

philr commented May 21, 2019

bzip2 uses the _stat function on Windows to determine whether the file to compress exists. This will return an error if the file size is greater than 232 - 1 bytes, resulting in the 'not a normal file' output.

I've added a patch to switch to _stati64 instead. This variant of the stat function supports 64-bit file sizes.

I've built a new release (v1.0.6.1) that includes the patch.

@Dobatymo
Copy link
Author

Thank you for this quick fix! I cannot believe that I am the first person to complain about this...

mmatuska pushed a commit to libarchive/bzip2 that referenced this issue Feb 9, 2020
The bzip2 command on Windows would report a 'not a normal file' error
for files of size greater than 2^32 - 1 bytes.

Use _stati64 instead of _stat so that a successful result is returned
for large files.

From: https://github.com/philr/bzip2-windows/blob/v1.0.6.1/patches/06-support_64bit_file_sizes.diff

See also: philr/bzip2-windows#3
zhaoxiu-zeng pushed a commit to LingYunZhi/bzip2 that referenced this issue Jan 20, 2022
The bzip2 command line would report 'not a normal file' for files of
size larger than 2^32 - 1 bytes.

Patch bzip2.c to use _stati64 instead of _stat so that a successful
result is returned for large files.

Resolves philr/bzip2-windows#3.
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