Documentation ¶
Index ¶
- func CopyFile(OldPath, NewPath string) error
- func Exists(path string) bool
- func ImgFileToB64(path string) (img string, err error)
- func IsDir(path string) bool
- func IsFile(path string) bool
- func Parent(dir string) (string, error)
- func Size(file string, ut Unit) (int64, error)
- func Split(path string) []string
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile :Copy a file to the given path @params OldPath : File path to be copied @params NewPath : File path to copy to @return: Return nil if the copy is successful, otherwise return an error message. @author: Yu.
func Exists ¶
Exists : Determines whether the file or folder exists @params path: @return: Return true if the given path exists, false otherwise @author: Yu.
func ImgFileToB64 ¶
ImgFileToB64 : Convert the image to base64 encoding @author: Yu.
func IsDir ¶
IsDir : Determine whether the given path is a folder @params path: @return: Return true if the given path is a folder, false otherwise @author: Yu.
func IsFile ¶
IsFile : Determine whether the given path is a file @params path: @return: Return true if the given path is a file, false otherwise @author: Yu.
func Parent ¶
Parent : Gets the upper path of the given path @params dir: @return: If the given path is a normal folder path, return the upper-level path, otherwise the file path error exception message is raised. @author: Yu.