file

package
v0.0.0-...-0b6a14b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2017 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(filepath string, data []byte) (err error)

Append opens an existing file or creates a new one and appends data to it.

func Exists

func Exists(filepath string) (exists bool)

Exists returns true if the file at the given path exists, false otherwise

func Read

func Read(filepath string) (data []byte, err error)

Read returns a byte slice of all bytes in the named file.

func ReadLines

func ReadLines(filepath string) (lines [][]byte, err error)

ReadLines returns a slice of strings, one for each line in the file.

func ReadN

func ReadN(filepath string, nBytes int64) (data []byte, err error)

ReadN returns a byte slice of the first nBytes of the named file. If nBytes is negative, the entire file size is used.

func Size

func Size(filepath string) (size int64)

Size returns the size of the file at the given path. The returned size will be negative if an error occurs.

func Write

func Write(filepath string, data []byte) (err error)

Write tramples an existing file or creates a new one and writes data to it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL