path

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidPath = errors.New("invalid path")
View Source
var ErrPathAlreadyExist = errors.New("path already exist")
View Source
var ErrPathNoExist = errors.New("path no exist")

Functions

func Exists added in v1.4.6

func Exists(path string) (bool, error)

Exists 确认文件或文件夹是否存在.

func JoinPath added in v1.1.9

func JoinPath(paths ...string) string

JoinPath 路径拼接.

func MakeDir

func MakeDir(path string, existReturnError bool) (err error)

MakeDir 创建单一目录, 不支持创建多级目录 path 路径 exist_no_error 路径已存在时是否返回错误.

func MakeDirIfNotPresent

func MakeDirIfNotPresent(path string) error

MakeDirIfNotPresent 目录不存在, 则创建; 存在则不操作 path 路径.

func MkDirs added in v1.4.6

func MkDirs(path ...string) error

MkDirs 创建多级目录.

func Relative2Abs

func Relative2Abs(relativePath string) (string, error)

Relative2Abs 相对路径转化绝对路径.

func RemovePath

func RemovePath(path string, noExistReturnError bool) (bool, error)

RemovePath 完全删除文件夹或文件, 对于文件夹包括子文件以及子文件夹 path 路径 noExistReturnError 路径不存在时是否返回错误.

func Split added in v1.4.6

func Split(path string) (string, string)

Split 路径分割, 返回目录以及文件名.

Types

This section is empty.

Jump to

Keyboard shortcuts

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