Pure MoonBit library to read and write tar files with streaming support
///|
test "README example" {
// Create a new archive
let archive = @tar.TarArchive::new()
// Add files and directories
archive.add_file("example.txt", "Hello, world!")
archive.add_directory("docs")
archive.add_file("docs/readme.md", "# Documentation")
// Get archive info
println("Archive has " + archive.count().to_string() + " entries")
// Extract all files
let files = @tar.extract_simple_archive(archive)
// Verify the extraction worked
if files.length() != 2 {
fail("Should extract 2 files (directories are skipped)")
}
}moon testpub struct ArchiveStats {
total_entries : Int
file_count : Int
directory_count : Int
symlink_count : Int
total_size : Int
} derive(Debug)impl Show for ArchiveStatsimpl Show for SimpleHeaderimpl Show for TarArchivePure MoonBit library to read and write tar files with streaming support