dir

package
v0.0.0-...-1e877d2 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDateDir

func CreateDateDir(path string, prex string) string

CreateDateDir 根据当前日期,不存在则创建目录

func CreateDir

func CreateDir(folderPath string)

CreateDir 不存在则创建目录

func CreateHourLogFile

func CreateHourLogFile(path string, prex string) string

CreateHourLogFile 根据当前小时创建目录和日志文件

func FileNameByDate

func FileNameByDate(dir string) string

FileNameByDate 根据当天日期和给定dir返回log文件名路径

func GetCurrentDirectory

func GetCurrentDirectory() string

GetCurrentDirectory 获得当前绝对路径

func GetDateDir

func GetDateDir(path string) string

GetDateDir 根据路径获得按照"年月日"生成的子路径

func LeftAddPathPos

func LeftAddPathPos(path string) string

LeftAddPathPos 检测并补全路径左边的反斜杠

func ReadDirAll

func ReadDirAll(path string, curHier int) ([]string, error)

ReadDirAll 读取目录 example ReadDirAll("/Users/why/Desktop/go/test", 0)

func RightAddPathPos

func RightAddPathPos(path string) string

RightAddPathPos 检测并补全路径右边的反斜杠

Types

type FileInfo

type FileInfo struct {
	Path      string
	Base      string
	BaseNoExt string
	Ext       string
	ExtNoSpot string
}

func GetPathInfo

func GetPathInfo(f string) (info FileInfo, err error)

GetPathInfo 获得路径信息

Jump to

Keyboard shortcuts

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