Closed kak13amaplus closed 1 year ago
Hi!
Which BitFileCompressor
's function are you using?
Could you provide any piece of the code?
Thank you!
using namespace bit7z;
try { Bit7zLibrary lib{ L"7z.dll" }; BitCompressor compressor{ lib, BitFormat::Zip };
//The first parameter is dir compressor.compressFiles( Dir, L"protected_archive.zip" );
} catch ( const BitException& ex ) {
//do something with ex.what()...
}
If an empty folder in Dir, the empty folder will not be compressed
I modified part of the code, compressFiles‘s param filter L" . " -> L"" FSIndexer::listDirectoryItems if ( item_matches ) -> if ( item_matches || current_item.isDir )
so that the empty folder can be compressed
include "bitcompressor.hpp"
using namespace bit7z;
try { Bit7zLibrary lib{ L"7z.dll" }; BitCompressor compressor{ lib, BitFormat::Zip };
//The first parameter is dir compressor.compressFiles( Dir, L"protected_archive.zip" );
} catch ( const BitException& ex ) { //do something with ex.what()...
}
If an empty folder in Dir, the empty folder will not be compressed
This is the expected default behavior of compressFiles
.
This function is meant to be used when you want to compress only the files inside the Dir
path; hence, empty folders will be ignored by default.
I modified part of the code, compressFiles‘s param filter L" . " -> L"" FSIndexer::listDirectoryItems if ( item_matches ) -> if ( item_matches || current_item.isDir )
so that the empty folder can be compressed
I think that the changes to FSIndexer::listDirectoryItems
are unnecessary.
Calling compressFiles
with L"*"
as the filter
parameter should suffice, e.g., compressor.compressFiles( Dir, L"protected_archive.zip", true, L"*" )
.
bit7z version
4.0.x beta
7-zip version
v21.07
7-zip DLL used
7z.dll
MSVC version
2019
Architecture
x86_64
Which version of Windows are you using?
Windows 10
Bug description
Why can't compress an empty directory?
Steps to reproduce
No response
Expected behavior
No response
Relevant compilation output
No response
Code of Conduct