Documentation ¶
Overview ¶
Package for working with files
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile It copies a file from one location to another - src: the source file - dst: the destination file - returns: the number of bytes copied and an error if there was a problem copying the file
func DownloadFile ¶
DownloadFile Download a file from a URL and save it to a filepath - url: the URL of the file to download - filepath: the path to save the file to - returns: an error if there was a problem downloading the file
func FileExists ¶
FileExists If the file exists, return true, otherwise return false - path: the path to the file - returns: true if the file exists, otherwise false
func ReadFile ¶ added in v0.2.2
ReadFile Read the contents of a file into a byte array - sourceFile: the path to the file to read - returns: the contents of the file as a byte array and an error if there was a problem reading the file
func ReadFileToString ¶
ReadFileToString Read the contents of a file into a string - sourceFile: the path to the file to read - returns: the contents of the file as a string and an error if there was a problem reading the file
func SaveStringToFile ¶
SaveStringToFile It creates a directory if it doesn't exist, then creates a file if it doesn't exist, then writes the content to the file - filename: the path to the file to write to - content: the content to write to the file - returns: an error if there was a problem writing the file
Types ¶
This section is empty.