You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encounter this strange bug where the compressed file cannot be extracted by Windows if it contains some specific file contents, however 7-zip works fine, probably is Windows being buggy again.
Currently my only option is changing the compress method to Stored, but I'd like to know if this can be fixed here.
To Reproduce
The code creates a zip file with Deflated method, resulting a zip file that cannot be fully extracted on Windows 10 and 11.
let file = std::fs::File::create("hash.zip")?;letmut zip = zip::ZipWriter::new(file);let options = SimpleFileOptions::default().compression_method(zip::CompressionMethod::Deflated);
zip.start_file("abc.txt", options)?;
zip.write_all(b"hello world\n")?;
zip.start_file("abc.sha256", options)?;
zip.write_all(b"abcdef1234567890edae5bb42a3d63129ef5b58157cb2980096f0be23cebccd0 abc.txt")?;
zip.start_file("123.sha256", options)?;// similar hash, only replacing the first 6 hex digits, but this file can be extracted
zip.write_all(b"1234561234567890edae5bb42a3d63129ef5b58157cb2980096f0be23cebccd0 abc.txt")?;
zip.finish()?;
after creating the hash.zip file, right click it then click extract all. Or, just open the zip file then try to open abc.sha256
Screenshots
Desktop (please complete the following information):
OS: Windows 11 IoT Enterprise LTSC
Version: 24H2
Additional context
The hash.zip generated by above code if you don't wanna run it: hash.zip
The text was updated successfully, but these errors were encountered:
Describe the bug
I've encounter this strange bug where the compressed file cannot be extracted by Windows if it contains some specific file contents, however 7-zip works fine, probably is Windows being buggy again.
Currently my only option is changing the compress method to
Stored
, but I'd like to know if this can be fixed here.To Reproduce
The code creates a zip file with
Deflated
method, resulting azip
file that cannot be fully extracted on Windows 10 and 11.after creating the
hash.zip
file, right click it then clickextract all
. Or, just open the zip file then try to openabc.sha256
Screenshots
Desktop (please complete the following information):
Additional context
The
hash.zip
generated by above code if you don't wanna run it: hash.zipThe text was updated successfully, but these errors were encountered: