cgiio

package
v0.0.0-...-e1ab6f8 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Utilities to easy input-output

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exists

func Exists(path string) bool

Exists returns true if path actually exists in file system

func HomeDir

func HomeDir() string

UserDir returns the name of user dir

func IsDirectory

func IsDirectory(path string) bool

Is directory return true if path exists and is a directory

func Lines

func Lines(path string, f func(s string))

Lines are read without end of line.

func List

func List(dir string) []os.FileInfo

List return the list of files of a directory

func Mkdir

func Mkdir(f string)

Mkdir makes a directory

func Mkdirs

func Mkdirs(f string)

Mkdirs makes a directory and its parents

func OpenAppend

func OpenAppend(path string) *os.File

OpenRead opens path for append. If fails throws a panic(error).

func OpenRead

func OpenRead(path string) *os.File

OpenRead opens path for read. If fails throws a panic(error).

func OpenWrite

func OpenWrite(path string) *os.File

OpenRead opens path for write. If fails throws a panic(error).

func ReadAll

func ReadAll(path string) string

ReadAll reads a data file completely. (File is open and closed)

func ReadAllBin

func ReadAllBin(path string) []byte

Read reads a file completely. (File is open and closed)

func Remove

func Remove(path string) error

Remove removes path and all its subdirectories.

func Rename

func Rename(oldname, newname string)

Rename changes the name of a file or directory

func TempDir

func TempDir(prefix string) string

TempDir makes a directorio in the temporal directory. If fails throws a panic(error),

func TempFile

func TempFile(dir string, prefix string) *os.File

TempFile creates a file in 'dir'. If 'dir' is "" file is created in the temporal directory.

func Unzip

func Unzip(archive, target string) error

Unzip a file or directory

func Write

func Write(file *os.File, text string)

Write writes a text in 'file'

func WriteAll

func WriteAll(path, text string)

WriteAll writes a text overwriting 'file'. (File is open and closed)

func WriteAllBin

func WriteAllBin(path string, data []byte)

WriteAll writes data overwriting 'file'. (File is open and closed)

func WriteBin

func WriteBin(file *os.File, data []byte)

Write writes binary data in 'file'

func Zip

func Zip(source, target string) error

Zip a file or directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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