|
Ctar
|
CTar is a simple tar-like program written in C. It supports the following features:
gzip compression and decompression are implemented using the zlib library.
The full doxygen generated documentation can be found at https://samymsa.github.io/ctar/
It is deployed automatically using the Doxygen GitHub Pages Deploy Action and uses the Doxygen Awesome theme.
sudo apt install build-essentialsudo apt install doxygensudo apt install graphvizsudo apt install lcovmake./bin/ctarNote: From now on, the program will be referred to as
ctarinstead of./bin/ctarfor simplicity.
The syntax of ctar is the following:
-l, --list ARCHIVE: List files in archive-e, --extract ARCHIVE: Extract files from archive-c, --create ARCHIVE: Create archive-d, --directory DIR: Change to DIR before performing any operations. Useful for creating or extracting files from/to a different directory than the current one-z, --compress: Compress or decompress the archive using gzip-v, --verbose: enable verbose mode-h, --help: display helpFILES...: The files to add to the archivectar -l archive.tar: List files in the archive.tar.ctar -e archive.tar: Extract files from archive.tar into the current directory.ctar -e archive.tar -d /tmp: Extract files from archive.tar into the /tmp directory.ctar -c archive.tar file1 file2 file3: Create archive.tar from file1, file2, and file3.ctar -c archive.tar -d /tmp file1 file2 file3: Create archive.tar from /tmp/file1, /tmp/file2, and /tmp/file3.ctar -z -c archive.tar.gz file1 file2 file3: Create compressed archive.tar.gz from file1, file2, and file3.ctar -z -e archive.tar.gz -d /tmp: Extract and decompress archive.tar.gz into the /tmp directory.ctar -c archive.tar -d /tmp file1 file2 file3: Create archive.tar from /tmp/file1, /tmp/file2, and /tmp/file3, changing to /tmp before the operation. This will result in the archive containing the files file1, file2, and file3, instead of /tmp/file1, /tmp/file2, and /tmp/file3.ctar -l archive.tar -v: List files in archive.tar in verbose mode. This will print detailed information about the files in the archive.ctar -e archive.tar -v -d /tmp: Extract files from archive.tar into the /tmp directory in verbose mode. This will print the names of the files as they are extracted.ctar -c archive.tar -v -d /tmp file1 file2 file3: Create archive.tar from /tmp/file1, /tmp/file2, and /tmp/file3, changing to /tmp before the operation, in verbose mode. This will print the names of the files as they are added to the archive.ctar -h: Display help.Here is non-exhaustive list of the available make targets:
make or make all: Compile the programmake docs: Generate documentationmake gcov: Generate coverage reportsmake package: Generate a tarball of the projectmake clean: Remove object filesmake mrproper: Remove object files, binaries, documentation, tests generated files, and coverage reports