nuts-archive: A tar like archive on top of a nuts-container.
Introduction
The nuts-archive is an application based on the nuts container. Inspired by
the tar tool you can store files, directories and symlinks in a nuts container.
- Entries can be appended at the end of the archive.
- They cannot be removed from the archive.
- You can travere the archive from the first to the last entry in the archive.
Examples
// Append an entry at the end of the archive
use Archive;
use ;
use ;
use TempDir;
// This will create an empty archive in a temporary directory.
let tmp_dir = ;
// Open the container (with a directory backend) from the temporary directory.
let backend_options = for_path;
let container_options = new
.with_password_callback
.
.unwrap;
let container =
open.unwrap;
// Open the archive
let mut archive = open.unwrap;
// Append a new entry
let mut entry = archive.append.build.unwrap;
entry.write_all.unwrap;
// Scans the archive for entries
use Archive;
use ;
use ;
use TempDir;
// This will create an empty archive in a temporary directory.
let tmp_dir = ;
// Open the container (with a directory backend) from the temporary directory.
let backend_options = for_path;
let container_options = new
.with_password_callback
.
.unwrap;
let container =
open.unwrap;
// Open the archive and append two entries
let mut archive = open.unwrap;
archive.append.build.unwrap;
archive.append.build.unwrap;
// Go through the archive
let entry = archive.first.unwrap.unwrap;
assert_eq!;
let entry = entry.next.unwrap.unwrap;
assert_eq!;
assert!;
License
You can check out the full license here.
This project is licensed under the terms of the MIT license.