Documentation ¶
Overview ¶
The file Package is meant to take care of all asset file opening so that file access is safe if trying to access a bundled file or a file from the disk
Index ¶
- func CreateDirectory(path string) error
- func Exists(filename string) bool
- func Ext(filename string) string
- func GetLastModified(filename string) time.Time
- func GetSize(filename string) int32
- func IsDirectory(filename string) bool
- func IsFile(filename string) bool
- func IsSymLink(filename string) bool
- func NewFileData(filename string) (os.FileInfo, error)
- func Read(path string) ([]byte, error)
- func ReadString(filename string) string
- func Register(data string)
- func Remove(path string) error
- type File
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirectory ¶
CreateDirectory will create all directories in the path given if they do not exist
func Exists ¶
Exists will return true if the file exists at the path provided and false if the file does not exist.
func GetLastModified ¶
GetLastModified will return the time of when the file was last modified, if the file does not exist the time will be 0
func GetSize ¶
GetSize will return the files size in bytes, it will return 0 if the file does not exist
func IsDirectory ¶
IsDirectory will return true if the path provided is a directory and false if the file does not exist or is not a directory.
func IsFile ¶
IsFile will return false if file does not exist or is directory. It will return true otherwise.
func IsSymLink ¶
IsSymLink will return false if the file does not exist or is not a symlink. It will return true if the file is a symlink
func NewFileData ¶
NewFileData retreives the file info for the path provided. If the file does not exist it will return an error
func Read ¶
Read will read a file at the path specified in total and return a byte array of the file contents
func ReadString ¶
ReadString acts like Read but instead return a string. This is useful in certain circumstances.