Documentation ¶
Index ¶
- Constants
- Variables
- func ChangeFileExt(filename, newExt string) string
- func DirExists(dir string) bool
- func FileExists(dir string) bool
- func FindFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func FindFullFilePath(name string) (string, error)
- func FindFullPathPath(name string) (string, error)
- func InitPathDirs(retset bool, rootPaths ...string)
- func OpenFile(pathfile string, fileflag int, filemode os.FileMode) (wc *os.File, err error)
- func PathJoin(dir, filename string) string
- func SetOSEnv(option, value string)
- func TransPath(path string) string
Constants ¶
View Source
const (
//EnvGoExeName 执行文件名称系统变量
EnvGoExeName = "EnvGoExeName"
)
Variables ¶
View Source
var ( //DefaultFileMode 默认的文件权限 0640 DefaultFileMode os.FileMode = 0640 //DefaultFolderMode 默认的文件夹权限 0750 DefaultFolderMode os.FileMode = 0750 //DefaultFileFlag linux下需加上O_WRONLY或是O_RDWR DefaultFileFlag int = os.O_APPEND | os.O_CREATE | os.O_WRONLY )
View Source
var ( //ExeName 执行文件名称 ExeName string )
Functions ¶
func ChangeFileExt ¶
ChangeFileExt 更改文件后缀名 eg:filename=`../a/test/aa.txt` newExt=`.csv` -->return=`../a/test/aa.csv`
func FindFullFilePath ¶
FindFullFilePath 查找相对目录文件的全路径文件 根据初始化的文件目录顺序查找文件(查文件不是查目录)
func FindFullPathPath ¶
FindFullPathPath 查找相对文件目录的全路径目录 根据初始化的文件目录顺序查找文件(查目录不是查文件)
func InitPathDirs ¶
InitPathDirs 初始化工程文件根目录 retset:是否重置默认的目录列表 。 rootPaths:新增的目录列表,如果没有设置指定根目录并未重置默认的目录的话,文件搜索规则为: 1:命令执行所在目录、2:可执行文件所在目录、3:可执行文件上一级目录...新增的路径列表,否则直接按照给的文件名称查找文件。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.