Closed anywhereyang closed 1 year ago
Hi!
You can build and use bit7z with the BIT7Z_AUTO_PREFIX_LONG_PATHS
option enabled to make the library correctly handle long paths on Windows.
It should fix your issue!
i downlaod bit7z-3.2.0.zip,and search 'BIT7Z_AUTO_PREFIX_LONG_PATHS' in the source files ,but not found,,how to use ?
Sorry, I thought you were using the latest v4 release candidate, which introduced the BIT7Z_AUTO_PREFIX_LONG_PATHS
option.
Unfortunately, the v3.2 doesn't support such an option.
When dealing with long paths, one possible workaround is to prepend the string \\?\
(\\\\?\\
escaped) to every path string you use (https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry).
E.g.:
extractor.extract(LR"(\\?\D:\Code\Game\Cef109\Bin\temp\23.7z)", LR"(\\?\D:\Code\Game\Cef109\Bin\temp\saddfsddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd)");
ok,thanks
You're welcome!
Feature description
23.7z has one file: safasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafasfffasfafasafa.txt
and the code will exception:
void Test() { try { bit7z::Bit7zLibrary lib{ L"7z.dll" }; bit7z::BitExtractor extractor{ lib, bit7z::BitFormat::SevenZip }; extractor.extract(LR"(D:\Code\Game\Cef109\Bin\temp\23.7z)", LR"(D:\Code\Game\Cef109\Bin\temp\saddfsddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd)"); } catch (const bit7z::BitException& e) { MessageBoxA(0,e.what(), "error", 0); int c = 0; } }
Additional context
No response
Code of Conduct