Documentation ¶
Index ¶
- func CreateDirectory(path string) (string, error)
- func CreateFile(path string) error
- func DeleteFile(filename string) error
- func GetCurrentDirectory() (string, error)
- func GetDirectory(path string) string
- func GetFileExt(path string) string
- func GetFileName(path string) string
- func GetFileNameWithoutExt(path string) string
- func GetFiles(path string) ([]string, error)
- func GetFilesByPattern(path string, searchPattern string) ([]string, error)
- func GetFolders(path string) ([]string, error)
- func GetFullPath(path string) string
- func IsDirectory(path string) bool
- func IsFile(path string) bool
- func PathExists(path string) bool
- func ReadAllBytes(filename string) ([]byte, error)
- func ReadAllString(filename string) (string, error)
- func WriteAllBytes(filename string, bytes []byte, isAppend bool) error
- func WriteString(filename string, str string, isAppend bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirectory ¶
CreateDirectory
@Description: 创建文件夹 @param path 文件路径或文件夹路径 @return string 文件夹路径 @return error 是否成功
func GetCurrentDirectory ¶
GetCurrentDirectory
@Description: 获取程序的当前工作目录 @return string @return error
func GetFileNameWithoutExt ¶
GetFileNameWithoutExt
@Description: 获取没有后缀名的文件名 @param path @return string
func GetFilesByPattern ¶ added in v0.0.9
GetFilesByPattern
@Description: 获取指定目录下面的所有文件 @param path @param searchPattern @return []string @return error
func GetFolders ¶ added in v0.0.15
GetFolders
@Description: 获取指定目录下面的所有文件夹 @param path @return []string @return error
func ReadAllBytes ¶
ReadAllBytes
@Description: 读取文件内容到数组 @param filename @return []byte @return error
func ReadAllString ¶
ReadAllString
@Description: 读取文件内容到字符串 @param filename @return string @return error
func WriteAllBytes ¶
WriteAllBytes
@Description: 写入字节数组,如果文件不存在则创建 @param filename @param bytes @param isAppend @return error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.