-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
[Bug]: Failed to open the output file: 拒绝访问。 #268
Comments
Hi!
Which folder are you extracting to?
Which compression software did you use?
The file wasn't uploaded properly, I cannot download it for testing it. |
Uploading 2025010701104793692966-31994233647-20241201-20241231-09-430501040031335 (1).7z.zip…
I have already re uploaded the file |
Thanks for the file, it really helped me figure out what is causing the problem! The main problem is that the archive contains a file with a Internally, bit7z uses In the meantime, there's a possible workaround to correctly extract the file to the output directory, which is to disable preserving the directory structure of the archive: BitFileExtractor extractor{ lib, BitFormat::Auto };
extractor.setRetainDirectories(false);
extractor.extract(zipFile, strOutDir.c_str()); |
extractor.setRetainDirectories(false); |
2025010701104793692966-31994233647-20241201-20241231-09-430501040031335 (1).7z.zip
bit7z version
4.0.x
Compilation options
BIT7Z_7ZIP_VERSION, BIT7Z_AUTO_FORMAT, BIT7Z_PATH_SANITIZATION
7-zip version
v23.01
7-zip shared library used
7z.dll / 7z.so
Compilers
MSVC
Compiler versions
vs2022
Architecture
x86_64
Operating system
Windows
Operating system versions
win11
Bug description
The file decompression is abnormal
Failed to open the output file: Access denied.
But other compression software can decompress this file normally
Uploading 2025010701104793692966.7z…
Filename:2025010701104793692966-31994233647-20241201-20241231-09-430501040031335 (1).7z.zip
Due to the prohibition of uploading 7z format files, a. zip file was added to the file name
After downloading, please delete the. zip file in the file name for testing
Steps to reproduce
bool UnzipTest(const wstring& zipFile, const wstring& strOutDir)
{
try
{
Bit7zLibrary lib;
BitFileExtractor extractor{ lib, BitFormat::Auto };
extractor.extract(zipFile, strOutDir.c_str());
}
catch (const bit7z::BitException& ex)
{
auto msg = ex.what();
auto code = ex.nativeCode();
auto posixCode = ex.posixCode();
return false;
}
return true;
}
Expected behavior
No response
Relevant compilation output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: