Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfError(err error)
- func CopyFile(source string, dest string) error
- func CreateFile(filename string) error
- func DirExists(path string) bool
- func DirFileSplit(path string) (string, string)
- func FileExists(path string) bool
- func GetDate() string
- func GetFileContent(path string) (string, error)
- func GetLastModified(path string) (time.Time, error)
- func GetLatestFormatDate(date1 string, date2 string) (string, error)
- func IsDiff(path1 string, path2 string) (bool, error)
- func IsMoreRecent(path1 string, path2 string) (bool, error)
- func IsMoreRecentTime(t1 time.Time, t2 time.Time) bool
- func IsSameTime(t1 time.Time, t2 time.Time) bool
- func IsWritable(filename string) bool
- func Mkdir(path string) error
- func SetDefPermission(path string) error
- func WriteToFile(filename string, content string) error
- type PathType
Constants ¶
View Source
const ( NONE PathType = -1 DIR PathType = 0 FILE PathType = 1 CONFDIR string = "/etc/dotfilesync" )
Variables ¶
View Source
var Layout = "2006-01-02 15:04:05"
Functions ¶
func CheckIfError ¶
func CheckIfError(err error)
func CreateFile ¶
func GetFileContent ¶
Get the contents of a file (non-buffered, so not ideal for large files)
func GetLastModified ¶
Get the ModTime of a file
func IsDiff ¶
Compare two files and calculate the difference. If a difference exists, return true, otherwise return false
func IsMoreRecent ¶
Compare the most recent ModTime of two files and determine if "path1" is more recent or not
func IsWritable ¶ added in v0.1.2
func SetDefPermission ¶
func WriteToFile ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.