Comments (7)
I can see the feature is there, the problem is it does not detect the archive type.
Folders count: 0
Files count: 3
Size: 13551341
Packed size: 13376716
Archive items
Item index: 0
Name: J110F_twrp.img.tar
Extension: tar
Path: J110F_twrp.img.tar
IsDir: 0
Size: 9533440
Packed size: 9359154
Item index: 1
Name: UPDATE-SuperSU-v2.46.zip
Extension: zip
Path: UPDATE-SuperSU-v2.46.zip
IsDir: 0
Size: 4017098
Packed size: 4017098
Item index: 2
Name: Password.txt
Extension: txt
Path: Password.txt
IsDir: 0
Size: 803
Packed size: 464
Cannot detect the format of the file <---After listing the archive I extract to buffer
from bit7z.
It is not working, it expects I input the path to the archive, not the path to the file.
So I think this is a valid feature request.
from bit7z.
Describe the solution you'd like
I can see that we can extract specific files by matching paths. However I'd like to extract a specific file to buffer.
I'm not sure how long it will take to implement this since my app needs this feature to extract webpages into a buffer.Additional context (optional)
Something like thisextractor.extract( L"path/to/another/file.txt", buffer );
Unfortunately, at the moment extracting a single file to a buffer by matching its name/path is not available: extraction by matching is supported only when the output target is the filesystem.
Implementing such functionality should not take much time, however it would potentially introduce redundancies in the code and avoiding them would take some time for reasoning; moreover, it would introduce also inconsistencies in the API which must be addressed!
It is not working, it expects I input the path to the archive, not the path to the file.
So I think this is a valid feature request.
Anyway, with the current version of bit7z there is a workaround: you can use the BitExtractor::extract(...) method, to which you can pass, as third parameter, the index (in the archive) of the file you need (you can get it using BitArchiveInfo if you don't already know it a priori).
For example:
const auto archive_name = L"archive.7z";
const auto file_path = L"path/to/another/file.txt"; // The path of the file you want to extract inside the archive
vector< byte_t > buffer;
BitArchiveInfo arc{ lib, archive_name, BitFormat::SevenZip };
auto arc_items = arc.items();
for ( auto& item : arc_items ) {
if ( item.path() == file_path ) {
// We have found the file we want to extract!
BitExtractor extractor{ lib, BitFormat::SevenZip };
extractor.extract( archive_name, buffer, item.index() );
break;
}
}
from bit7z.
Thanks for taking time to respond and also for the info. I will try this method instead.
from bit7z.
You're welcome!
from bit7z.
Could we possibly get the ability to use pre-allocated C style buffers (eg: void *buf)?
Trying to use the library to load game files, but allocation of a new buffer and then copying is forcing me to double the ram usage of large files (700mb) on a 32 bit process, and running out of memory.
from bit7z.
Could we possibly get the ability to use pre-allocated C style buffers (eg: void *buf)?
Trying to use the library to load game files, but allocation of a new buffer and then copying is forcing me to double the ram usage of large files (700mb) on a 32 bit process, and running out of memory.
Supporting C style buffers would require really many changes in the internal code of bit7z, which extensively uses std::vector
.
Anyway, for the next version I will evaluate how to support it, but it won't be anytime soon (due to other commitments).
from bit7z.
Related Issues (20)
- [Feature Request]: custom suffix format HOT 1
- [Bug]: Issues regarding the Fat32 and Exfat file systems HOT 8
- [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
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.