Skip to content

anuradhaindika83/simpleio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

simpleio - File handling simplified

Information

This library extended the Go file handling APIs. This provides some useful functions which are missing in the Go file handling package

Installation

go get github.com/anuradhaindika83/simpleio

Usage

    package main

    import (
    	"fmt"
    	"github.com/anuradhaindika83/simpleio"
    )

    func main() {
    	file := simpleio.FileHandler{}
    	file.OpenFile("test.txt")
        line := file.ReadLine()
        fmt.Println(line)
        //Checking for end of file
        if file.EOF != false {
           line = file.ReadLine()
           fmt.Println(line)
        }

        //Closing file
        file.Close()
    }

Available APIs

(*FileHandler) OpenFile(file string)
(*FileHandler) ReadLine()
(*FileHandler) ReadLines() []string
(*FileHandler) ReadBlock(start int64, count int64) string
(*FileHandler) ReadToEnd() string
(*FileHandler) Reset()

About

Simplified set of APIs for file handling in Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages