Documentation ¶
Overview ¶
Package file provides simple utility functions to be used with files
Index ¶
- func Copy(src, dst string) error
- func Delete(file string) bool
- func Exists(file string) bool
- func ExistsOk(file string) (bool, error)
- func GetAbsolutePath(subfolder ...string) (string, error)
- func GetCurrentPath() (string, error)
- func IsFile(file string) bool
- func IsFileOk(file string) (bool, error)
- func IsUserFile(fi os.FileInfo) bool
- func MkdirAll(file string) bool
- func PrintFile(name string)
- func WriteFile(name string, content []byte, append bool) bool
- type CopyEnv
- type FileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Copy ¶
Copy copies the file or directory from source path to destination path with the standart copy environment. For more control create a custom copy environment.
func Exists ¶
Exists checks whether the given file exists or not. It panics if an error is occured. Use ExistsOk to use the returned error.
func GetAbsolutePath ¶
GetAbsolutePath 获取当前执行文件的绝对路径目录 subfolder 子目录,如果没有,自动创建
func IsFile ¶
IsFile checks wether the given file is a directory or not. It panics if an error is occured. Use IsFileOk to use the returned error.
func IsUserFile ¶
IsUserFile ignores editor backups, hidden files and folders/symlinks.
Types ¶
Click to show internal directories.
Click to hide internal directories.