rikyoz / bit7z

A C++ static library offering a clean and simple interface to the 7-zip shared libraries.
https://rikyoz.github.io/bit7z
Mozilla Public License 2.0
602 stars 110 forks source link

[Bug]: #192

Closed dengyintao closed 4 months ago

dengyintao commented 4 months ago

bit7z version

3.2.x

Compilation options

BIT7Z_7ZIP_VERSION

7-zip version

v19.00

7-zip shared library used

7z.dll / 7z.so

Compilers

MSVC

Compiler versions

MSVC2017

Architecture

x86

Operating system

Windows

Operating system versions

Windows 10

Bug description

when i use bit7z compress files out to stream,if the files contains office file(.docx .xls),The output stream will be interrupted in the office file

code: Bit7zLibrary lib{L"C:\Users\1\Desktop\testbit7z\Debug\7z.dll"}; //BitCompressor compressor{lib, BitFormat::Zip}; std::vector files = { L"C:\Users\1\Desktop\testbit7z\testfile\中文中文.txt", L"C:\Users\1\Desktop\testbit7z\testfile\测试中文.txt", L"C:\Users\1\Desktop\testbit7z\testfile\test.xls", L"\\?\C:\Users\1\Desktop\testbit7z\testfile\dasdklasdlsahdahjfasdlfhhjlkfhdsalhfjldhsajkflhjfhsaldkhfjadkshfjkldashfkjldashfjkldhsjklfhasdjklfhsdajklfhsdlkjafhljkasdhfjkadshfjlkasdhfkjlsdahfkjlasdhfjkldsahfjklsahfjkashdfkjlhsdajklfhsdkjlafhjksadhfkjdsahfjk.txt", L"\\?\C:\Users\1\Desktop\testbit7z\testfile\221dasdklasdlsahdahjfasdlfhhjlkfhdsalhfjldhsajkflhjfhsaldkhfjadkshfjkldashfkjldashfjkldhsjklfhasdjklfhsdajklfhsdlkjafhljkasdhfjkadshfjlkasdhfkjlsdahfkjlasdhfjkldsahfjklsahfjkashdfkjlhsdajklfhsdkjlafhjksadhfkjdsahfjk.txt" };

BitCompressor compressor2{lib, BitFormat::Tar};
std::stringstream a;
compressor2.compress(files, a);

std::ofstream out;
out.open("C:\\1.tar",std::ios::app);
out <<a.str();
out.close();

Steps to reproduce

No response

Expected behavior

No response

Relevant compilation output

No response

Code of Conduct