Comments (2)
Hi!
Thanks for reporting the bug!
After reading the source code, it was found that the file suffix name should be determined first. If the determination is successful, detectFormatFromSig will not be run for file configuration determination, which may cause compressed files to not open properly
I replicated your usage scenario, and indeed bit7z fails to detect the format.
However, the problem is not that detectFormatFromSig
is not called.
The BitInputArchive::openArchiveStream
method takes into account precisely the case where a format was detected from the extension, but we could not open the archive:
HRESULT res = in_archive->Open( in_stream, nullptr, open_callback );
if ( res != S_OK && mArchiveHandler.format() == BitFormat::Auto && !detected_by_signature ) {
/* ... */
mDetectedFormat = &( detectFormatFromSig( in_stream ) );
...
}
The actual problem is that, in some cases, the call to Open
might change the state of the underlying file stream so that when detectFormatFromSig
tries to read the file signature, it fails, hence the format detection error.
I've pushed a commit to the develop
branch that fixes this issue.
Thank you again! đ
from bit7z.
Fixed in v4.0.0.
from bit7z.
Related Issues (20)
- [Bug]: Errors related to file compression HOT 4
- [Feature Request]: Can you provide a method for setting the file time HOT 1
- [build-error]: Failed to open the archive file: No such process HOT 2
- [Bug]: UpdateMode::Update not working as expected, throwing exception HOT 3
- [Feature Request]: Creation or extraction archive file in one line HOT 1
- [Feature Request]: Support for compressed packages in four formats: ace, img, uue, and war HOT 2
- [Feature Request]: Extracting files whose names contain forbidden characters HOT 1
- Do I need to build 7zip myself? HOT 6
- [Bug]:
- [Bug]: Multiple Definition Linker Error for IID_IUnknown HOT 10
- [Bug]: BIT7Z_DISABLE_USE_STD_FILESYSTEM not working HOT 4
- [Bug]: Compile error when bit7z.lib is introduced into the project. HOT 11
- [Feature Request]: Is "tstring_to_path" forgotten here? HOT 1
- [Bug]: HOT 3
- [Feature Request]: Compresses files open for writing by another applications HOT 1
- [Bug]: CreateObject ćœæ°è°çšćŒćžž
- [Bug]: core dump with BitArchiveWriter HOT 9
- [Bug]: Some zip file names are garbled HOT 5
- [Bug]: HOT 3
- [Possible Bug]: BitArchiveReader::items is slow? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
đ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. đđđ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google â€ïž Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bit7z.