hiboot: hidevops.io/hiboot/pkg/utils/io Index | Files

package io

import "hidevops.io/hiboot/pkg/utils/io"

Package io provides file or directory io utilities.

Index

Package Files

io.go

func BaseDir Uses

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 Uses

func Basename(s string) string

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

func CallerInfo Uses

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

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

func ChangeWorkDir Uses

func ChangeWorkDir(workDir string) error

ChangeWorkDir change current working dir

func CreateFile Uses

func CreateFile(path, filename string) error

CreateFile create file

func DirName Uses

func DirName(s string) string

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

func EnsureWorkDir Uses

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

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

func Filename Uses

func Filename(s string) string

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

func GetRelativePath Uses

func GetRelativePath(level int) string

GetRelativePath get relative path

func GetWorkDir Uses

func GetWorkDir() string

GetWorkDir get current working dir

func IsPathNotExist Uses

func IsPathNotExist(path string) bool

IsPathNotExist check if path is not exist

func Visit Uses

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

Visit get files in a specific dir

func WriterFile Uses

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

WriterFile write bytes to file

Package io imports 5 packages (graph) and is imported by 20 packages. Updated 2019-10-17. Refresh now. Tools for package owners.