开源项目-verybluebot-tarinator-go.zip

  • l4_405721
    了解作者
  • 4.7KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-03 22:54
    上传日期
开源项目-verybluebot-tarinator-go.zip,Tarinator-go: a Golang package for taring and untaring files with ease
verybluebot-tarinator-go.zip
  • tarinator-go-master
  • tarinator_test.go
    941B
  • somescript.sh
    56B
  • tarinator.go
    2.5KB
  • LICENSE.md
    1KB
  • .gitignore
    14B
  • test_files
  • bla
  • bla
    4B
  • somedata.json
    583B
  • README.md
    1.6KB
内容介绍
# Tarinator-go ## Genaral Tarinator-go a Golang package that simplifies creating tar files and compressing/decompressing them using gzip. Here is an example for using Tarinator-go (including a tutorial for building it): https://github.com/verybluebot/cli_tarinator_example ## Usage At this point it can create .tar and tar.gz files from unlimited number of files and directories. ### Creat Tar file: creating `.tar` file from a list of files and/or directories: ``` // create an []string of paths to your files and directories import( "github.com/verybluebot/tarinator-go" ) paths := []string{ "someFile.txt", "someOtherFile.json", "someDir/", "some/path/to/dir/", } err := tarinator.Tarinate(paths, "your_tar_file.tar") if err != nil { // handle error } ``` For creating `.tar.gz` file use `.tar.gz` to the file name aka `your_tar_file.tar.gz`. ### Extarcing a tar file For extarcting the tar file just give input the file path and the destenetion to extract in the example below the tar file is in `/home/someuser/some_tar.tar` and the destenation is `/tmp/things/`. ``` import( "github.com/verybluebot/tarinator-go" ) err := tarinator.UnTarinate("/home/someuser/some_tar.tar", "/tmp/things/") if err != nil { // handle error } ``` For extracting `.tar.gz` files just specify a `.tar.gz` file name and Tarinator-go will recognize it. ## Thanks to Svett Ralchev for [this blog post](http://blog.ralch.com/tutorial/golang-working-with-tar-and-gzip/) which helped in creation of Tarinator-go ## Licence [MIT](https://github.com/verybluebot/cli_tarinator_example/blob/master/LICENCE.md)
评论
    相关推荐
    • golang
      故事
    • GoLang
      高朗
    • Golang
      Golang
    • GOLANG
      GOLANG
    • golang
      高朗
    • Golang练习
      Golang练习 这是我练习在Go中学到的东西的地方:)
    • golang
      golang
    • golang
      golang
    • golang
      #golang
    • Golang
      去 Go是一种开放源代码编程语言,可轻松构建简单,可靠和高效的软件。 下载Go $ go version go version go1.16 windows/amd64