fileutil

package
v0.0.0-...-034a78d Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeToml

func DecodeToml(fileName string, v interface{}) error

DecodeToml decodes data from file using toml format

func DirAppendSepa

func DirAppendSepa(dirPath string) string

DirAppendSepa returns dir path end with file separator

func EncodeToml

func EncodeToml(fileName string, v interface{}) error

EncodeToml encodes data into file using toml format, encode data to tmp file, if success then rename tmp => target file

func Exist

func Exist(file string) bool

Exist check file or dir if exist

func ListDir

func ListDir(path string) ([]string, error)

ListDir reads the directory named by dirname and returns a list of filename.

func Map

func Map(path string) ([]byte, error)

Map memory-maps a file.

func MkDir

func MkDir(path string) error

MkDir create dir

func MkDirIfNotExist

func MkDirIfNotExist(path string) error

MkDirIfNotExist creates given dir if it not exist

func RWMap

func RWMap(path string, size int) ([]byte, error)

RWMap maps a file for read and write with give size. New file is created is not existed.

func RemoveDir

func RemoveDir(path string) error

RemoveDir deletes dir include children if exist

func Sync

func Sync(data []byte) error

func Unmap

func Unmap(data []byte) error

Unmap closes the memory-map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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