Browse Source

Add alternative shell commands to system::archiveDirectory() and unarchiveToDirectory().

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
44a11a3ffc
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      include/system.hpp

+ 8
- 0
include/system.hpp View File

@@ -124,6 +124,10 @@ void writeFile(const std::string& path, const std::vector<uint8_t>& data);
Uses the Unix Standard TAR + Zstandard format (.tar.zst). Uses the Unix Standard TAR + Zstandard format (.tar.zst).
An equivalent shell command is An equivalent shell command is


tar -c -C dirPath . | zstd -1 -o archivePath

or

ZSTD_CLEVEL=1 tar -cf archivePath --zstd -C dirPath . ZSTD_CLEVEL=1 tar -cf archivePath --zstd -C dirPath .


Throws on error. Throws on error.
@@ -134,6 +138,10 @@ std::vector<uint8_t> archiveDirectory(const std::string& dirPath, int compressio
/** Extracts an archive into a directory. /** Extracts an archive into a directory.
An equivalent shell command is An equivalent shell command is


zstd -d < archivePath | tar -x -C dirPath

or

tar -xf archivePath --zstd -C dirPath tar -xf archivePath --zstd -C dirPath


Throws on error. Throws on error.


Loading…
Cancel
Save