tar v0.2.0

A tar library

README


tar.um

A tar archive library for Umka. Install using PAK.

Example

import (
        "pak/tar/tar.um"
)

fn main() {
    var err: tar.Errno
    var t: tar.Tar
        
    t, err = tar.open("test.tar", "w")
    if err != 0 {
        printf("Error opening tar file: %s\n", tar.strerror(err))
        return
    }
    
    t.addFile("pak.json")
    t.addFile("pak/")
    t.addFile("README.md")
    
    err = t.finalize()
    if err != 0 {
        printf("Error finalizing tar file: %s\n", tar.strerror(err))
        return
    }
    
    err = t.close()
    if err != 0 {
        printf("Error closing tar file: %s\n", tar.strerror(err))
        return
    }
    
    t, err = tar.open("test.tar", "r")
    if err != 0 {
        printf("Error opening tar file: %s\n", tar.strerror(err))
        return
    }
        
    err = t.extract("extracted")
    if err != 0 {
        printf("Error extracting tar file: %s\n", tar.strerror(err))
        return
    }
    
    err = t.close()
    if err != 0 {
        printf("Error closing tar file: %s\n", tar.strerror(err))
        return
    }
}

License

Unlicense/MIT

Homepage

Documentation

License: Unlicense/MIT

Download count: 17


To add this package to your project run:

umbox install tar

Or download as a tar.


Dependencies

Last updated

2024-02-23T19:23:52