pathutil

package
v2.0.0-alpha.16 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDir

func BuildDir(absDir string) error

BuildDir 创建目录

func CheckFileIsExist

func CheckFileIsExist(filename string) bool

CheckFileIsExist 检查目录是否存在

func CheckPermission

func CheckPermission(src string) bool

CheckPermission check if the file has permission

func CopyDir

func CopyDir(source, dest string) (err error)

CopyDir copies the source directory to the dest directory.

func CopyFile

func CopyFile(source, dest string) (err error)

CopyFile copies the source file to the dest file.

func DeleteFile

func DeleteFile(absDir string) error

DeleteFile 删除文件或文件夹

func DirName

func DirName(argv ...string) string

func Exist

func Exist(fileName string) bool

Exist checks whether a file or directory exists. It returns false when the file or directory does not exist.

func GetCurrentDirectory

func GetCurrentDirectory() string

GetCurrentDirectory 获取程序运行路径

func GetModelPath

func GetModelPath() string

GetModelPath 获取目录地址

func GetPathDirs

func GetPathDirs(absDir string) (re []string)

GetPathDirs 获取目录所有文件夹

func GetPathFiles

func GetPathFiles(absDir string) (re []string)

GetPathFiles 获取目录所有文件

func GetProPath

func GetProPath() string

func GrepFile

func GrepFile(patten, filename string) (lines []string, err error)

GrepFile like command grep -E for example: GrepFile(`^hello`, "hello.txt") \n is striped while read

func IsDir

func IsDir(path string) bool

IsDir determines whether the specified path is a directory.

func IsExist

func IsExist(path string) bool

IsExist determines whether the file spcified by the given path is exists.

func IsNotExist

func IsNotExist(src string) bool

IsNotExist check if the file exists

func IsNotExistMkDir

func IsNotExistMkDir(src string) (err error)

IsNotExistMkDir create a directory if it does not exist

func List

func List(dirPth, suffix string) (files []string, err error)

List list file

func ListDir

func ListDir(dirPth, suffix string) (files []string, err error)

ListDir list dir

func MkDir

func MkDir(src string) error

MkDir create a directory

func PathExists

func PathExists(path string) (bool, error)

PathExists path is exist

func Search(fileName string, paths ...string) (fullpath string, err error)

Search Search a file in paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

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