io

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package io provides file or directory io utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseDir

func BaseDir(s string) string

BaseDir get base dir from a path /a/b/c.ext => /a/b /a/b/c => /a/b

func Basename

func Basename(s string) string

Basename get the base name from a path /a/b/c.ext => /a/b/c

func CallerInfo added in v0.5.3

func CallerInfo(skip int) (file string, line int, fn string)

CallerInfo get call info, include filename, line number or function name

func ChangeWorkDir

func ChangeWorkDir(workDir string) error

ChangeWorkDir change current working dir

func CreateFile

func CreateFile(path, filename string) error

CreateFile create file

func DirName

func DirName(s string) string

DirName get dir name from a path /a/b/c => c

func EnsureWorkDir

func EnsureWorkDir(skip int, dir string) (ok bool)

EnsureWorkDir ensure the working dir is set the correct dir specified by user

func Filename

func Filename(s string) string

Filename get file name from a path /a/b/c.ext => c.ext

func GetRelativePath

func GetRelativePath(level int) string

GetRelativePath get relative path

func GetWorkDir

func GetWorkDir() string

GetWorkDir get current working dir

func IsPathNotExist

func IsPathNotExist(path string) bool

IsPathNotExist check if path is not exist

func Visit

func Visit(files *[]string) filepath.WalkFunc

Visit get files in a specific dir

func WriterFile

func WriterFile(path, filename string, in []byte) (int, error)

WriterFile write bytes to file

Types

This section is empty.

Jump to

Keyboard shortcuts

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