fileutil

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exist

func Exist(file string) bool

Exist checks file or dir if exist.

func GetDirectoryList

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

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

func GetExistPath

func GetExistPath(path string) string

GetExistPath gets exist path based on given path.

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(f *os.File) ([]byte, error)

Map memory-maps a file.

func MkDir

func MkDir(path string) error

MkDir creates dir.

func MkDirIfNotExist

func MkDirIfNotExist(path string) error

MkDirIfNotExist creates given dir if it's not exist.

func RWMap

func RWMap(f *os.File, size int) (data []byte, err 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 RemoveFile

func RemoveFile(file string) error

RemoveFile removes the file if exist.

func Sync

func Sync(data []byte) error

func Unmap

func Unmap(f *os.File, 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