-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💥 Dependency reversal (#369) Dependency reversal `portable-network-ar…
…chive` depends on `pna` * 💥 Dependency reversal `portable-network-archive` depends on `pna` * 📝 Update README.md
- Loading branch information
Showing
16 changed files
with
191 additions
and
61 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Portable Network Archive | ||
|
||
PNA (Portable Network Archive) is a highly scalable archive format that can be compressed, encrypted, and split. | ||
Also, its data structure is inspired by the PNG data structure. | ||
|
||
## Installation | ||
|
||
### Via Cargo | ||
|
||
```sh | ||
cargo install portable-network-archive | ||
``` | ||
|
||
### From Source (via Cargo) | ||
|
||
```sh | ||
git clone https://github.com/ChanTsune/Portable-Network-Archive.git | ||
``` | ||
|
||
```sh | ||
cargo install --path cli | ||
``` | ||
|
||
## Usage | ||
|
||
### Creating an Archive | ||
|
||
```sh | ||
pna create <ARCHIVE> [FILES]... | ||
``` | ||
|
||
### Extracting an Archive | ||
|
||
```sh | ||
pna extract <ARCHIVE> | ||
``` | ||
|
||
### Listing Archived Entries | ||
|
||
```sh | ||
pna list <ARCHIVE> | ||
``` | ||
|
||
Use the following command to get help. | ||
|
||
```sh | ||
pna --help | ||
``` | ||
|
||
# License | ||
|
||
This project is licensed under either of | ||
|
||
* Apache License, Version 2.0, ([LICENSE-APACHE](../LICENSE-APACHE) or | ||
http://www.apache.org/licenses/LICENSE-2.0) | ||
* MIT license ([LICENSE-MIT](../LICENSE-MIT) or | ||
http://opensource.org/licenses/MIT) | ||
|
||
at your option. | ||
|
||
### Contribution | ||
|
||
Unless you explicitly state otherwise, any contribution intentionally submitted | ||
for inclusion in this project by you, as defined in the Apache-2.0 license, | ||
shall be dual licensed as above, without any additional terms or conditions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,92 @@ | ||
# Portable-Network-Archive | ||
# pna | ||
[![test](https://github.com/ChanTsune/Portable-Network-Archive/actions/workflows/test.yml/badge.svg)](https://github.com/ChanTsune/Portable-Network-Archive/actions/workflows/test.yml) | ||
[![Crates.io][crates-badge]][crates-url] | ||
|
||
Portable-Network-Archive (PNA) | ||
Highly scalable archive format inspired by the PNG data structure with file compression, splitting and encryption. | ||
[crates-badge]: https://img.shields.io/crates/v/pna.svg | ||
[crates-url]: https://crates.io/crates/pna | ||
|
||
## Installation | ||
A pna archive reading/writing library for Rust. | ||
|
||
```toml | ||
# Cargo.toml | ||
[dependencies] | ||
pna = "0.5" | ||
``` | ||
|
||
## Reading an archive | ||
|
||
```rust | ||
use pna::{Archive, ReadOption}; | ||
use std::fs::File; | ||
use std::io::{self, copy, prelude::*}; | ||
|
||
fn main() -> io::Result<()> { | ||
let file = File::open("foo.pna")?; | ||
let mut archive = Archive::read_header(file)?; | ||
for entry in archive.entries() { | ||
let entry = entry?; | ||
let mut file = File::create(entry.header().path().as_path())?; | ||
let mut reader = entry.reader(ReadOption::builder().build())?; | ||
copy(&mut reader, &mut file)?; | ||
} | ||
Ok(()) | ||
} | ||
``` | ||
|
||
## Writing an archive | ||
|
||
```rust | ||
use pna::{Archive, EntryBuilder, WriteOption}; | ||
use std::fs::File; | ||
use std::io::{self, prelude::*}; | ||
|
||
fn main() -> io::Result<()> { | ||
let file = File::create("foo.pna")?; | ||
let mut archive = Archive::write_header(file)?; | ||
let mut entry_builder = EntryBuilder::new_file( | ||
"bar.txt".try_into().unwrap(), | ||
WriteOption::builder().build(), | ||
)?; | ||
entry_builder.write(b"content")?; | ||
let entry = entry_builder.build()?; | ||
archive.add_entry(entry)?; | ||
archive.finalize()?; | ||
Ok(()) | ||
} | ||
``` | ||
|
||
# CLI | ||
Command line user interface are available and you can install via cargo or build from source. | ||
|
||
### Via Cargo | ||
|
||
```sh | ||
cargo install pna --features cli | ||
cargo install portable-network-archive | ||
``` | ||
|
||
## Usage | ||
### From Source (via Cargo) | ||
|
||
Use the following command to get help. | ||
```sh | ||
git clone https://github.com/ChanTsune/Portable-Network-Archive.git | ||
``` | ||
|
||
```sh | ||
pna --help | ||
cargo install --path cli | ||
``` | ||
|
||
## Specification | ||
# License | ||
|
||
This project is licensed under either of | ||
|
||
* Apache License, Version 2.0, ([LICENSE-APACHE](../LICENSE-APACHE) or | ||
http://www.apache.org/licenses/LICENSE-2.0) | ||
* MIT license ([LICENSE-MIT](../LICENSE-MIT) or | ||
http://opensource.org/licenses/MIT) | ||
|
||
at your option. | ||
|
||
### Contribution | ||
|
||
For more detail read [Specification](../Specification.md) | ||
Unless you explicitly state otherwise, any contribution intentionally submitted | ||
for inclusion in this project by you, as defined in the Apache-2.0 license, | ||
shall be dual licensed as above, without any additional terms or conditions. |
Oops, something went wrong.