Skip to content

Golang io functions that provide standard scanner interfaces for compressed files.

License

Notifications You must be signed in to change notification settings

abeconnelly/autoio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

autoio.go

A lightweight (and work in progress) Go library to provide a simple interface to use compressed files like you use normal files.

Installation

$ go get github.com/abeconnelly/autoio

Example

package main

import "fmt"
import "github.com/abeconnelly/autoio"

func parrot_file( fn string ) {
  aio,err := autoio.OpenScanner( fn )
  if err!=nil { panic(err) }
  defer aio.Close()

  for aio.Scanner.Scan()  {
    l := aio.Scanner.Text()
    fmt.Println(l)
  }

}

func main() {

  parrot_file( "w.txt" )
  parrot_file( "x.txt.gz" )
  parrot_file( "y.txt.bz2" )
  parrot_file( "-" )

}

About

Golang io functions that provide standard scanner interfaces for compressed files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages