Documentation
¶
Index ¶
Constants ¶
const ( OS_READ = 04 OS_WRITE = 02 OS_EX = 01 OS_USER_SHIFT = 6 OS_GROUP_SHIFT = 3 OS_OTH_SHIFT = 0 OS_USER_R = OS_READ << OS_USER_SHIFT OS_USER_W = OS_WRITE << OS_USER_SHIFT OS_USER_X = OS_EX << OS_USER_SHIFT OS_USER_RW = OS_USER_R | OS_USER_W OS_USER_RWX = OS_USER_RW | OS_USER_X OS_GROUP_R = OS_READ << OS_GROUP_SHIFT OS_GROUP_W = OS_WRITE << OS_GROUP_SHIFT OS_GROUP_X = OS_EX << OS_GROUP_SHIFT OS_GROUP_RW = OS_GROUP_R | OS_GROUP_W OS_GROUP_RWX = OS_GROUP_RW | OS_GROUP_X OS_OTH_R = OS_READ << OS_OTH_SHIFT OS_OTH_W = OS_WRITE << OS_OTH_SHIFT OS_OTH_X = OS_EX << OS_OTH_SHIFT OS_OTH_RW = OS_OTH_R | OS_OTH_W OS_OTH_RWX = OS_OTH_RW | OS_OTH_X OS_ALL_R = OS_USER_R | OS_GROUP_R | OS_OTH_R OS_ALL_W = OS_USER_W | OS_GROUP_W | OS_OTH_W OS_ALL_X = OS_USER_X | OS_GROUP_X | OS_OTH_X OS_ALL_RW = OS_ALL_R | OS_ALL_W OS_ALL_RWX = OS_ALL_RW | OS_GROUP_X )
Useful permissions constants example provided via StackOverflow: https://stackoverflow.com/a/42718395/33611 noinspection GoSnakeCaseUsage,GoUnusedConst
const PathSeparator = string(os.PathSeparator)
PathSeparator is the OS dependent path separator character as a string.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile copies file from source to destination on the file system. Returns the number of bytes copied and an optional error.
func FindInPath ¶
FindInPath searches the PATH and the local directory structure for a file.
func IsRegularFileOrDirectory ¶ added in v0.0.3
IsRegularFileOrDirectory returns true if the referenced FileInfo object is a normal file or directory and not a symlink, device or other specialized file type.
func PathExistsAndIsFileOrDirectory ¶ added in v0.0.3
PathExistsAndIsFileOrDirectory checks to see if a given path exists and if it is a directory or regular file. If the check is successful this function will return nil. Otherwise, it will return an error indicating the problem with the path.
func TempDirectoryPath ¶
TempDirectoryPath returns a path under the system temporary directory.
Types ¶
This section is empty.