-
is it possible to add only a directory item (w/o files) to a specific path in the archive? how to correctly compress symlinks, especially those pointing to directories? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hi!
Bit7z allows adding only items existing on the filesystem, so you cannot add an empty non-existing directory. I might add this feature in the next versions of the library, though! If you plan to add some files to the new directory inside the archive, you might achieve something similar by specifying a custom path, e.g.: Bit7zLibrary lib{ "7z.dll" };
BitArchiveWriter writer{ lib, BitFormat::SevenZip };
writer.addFile( "path/to/file.txt", "new-directory/file.txt" );
writer.compressTo( "output.7z" ); In this way, you're not directly creating an empty directory item, but the resulting archive will contain a directory with a custom name that will contain the files.
You should be able to add symbolic links via the |
Beta Was this translation helpful? Give feedback.
-
also what is the best way to handle the situation when bitarchivereader received an archive with an encrypted header if the password was not set in advance? |
Beta Was this translation helpful? Give feedback.
-
hi again is it possible to extract multiple items in predefined paths, but not into memory or a single output directory? atm im using extraction one by one in ostream, which is very slow with large solid archives. |
Beta Was this translation helpful? Give feedback.
addFile
ignoring empty directories is the expected behavior; on the other hand, this method should preserve the dates/attributes of the file being added, so I'll need to investigate this.Yeah, it's the expected behavior.
This is probably due to the fact that the duplicates check is performed only in the case of updating an existing archive, and it considers only duplicates between the new items being added and the old ones alre…