Documentation
¶
Index ¶
- func AppendToFd(fd *os.File, strToAdd, patToCheck string) error
- func CmdPipe(cmd1bin, cmd1args, cmd2bin, cmd2args string) error
- func CopyDir(srcDir, dstDir string) error
- func CopyFile(srcFile, dstFile string, dstFilePermissions os.FileMode, ...) error
- func CreateDirRecursively(dirToCreate string, permissions os.FileMode, owner, group int, ...) error
- func FindAndReplace(srcFile, dstFile, oldPattern, newPattern string, filePermissions os.FileMode) error
- func FindAndReplaceFd(fd *os.File, oldPattern, newPattern string) error
- func FindAndReplaceMulti(srcFile, dstFile string, patternMap map[string]string, ...) error
- func MyCopy(src, dst string, dstFilePermissions os.FileMode, ...) error
- func PatternFound(file, pattern string) bool
- func RemoveIfExists(handleError bool, paths ...string) error
- func WriteToFile(pathToFile string, opt int, data string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
func CopyFile(srcFile, dstFile string, dstFilePermissions os.FileMode, dstFileOwner, dstFileGroup int, removeOriginal bool) error
copyFile copies a file. Returns amount of written bytes and error
func CreateDirRecursively ¶
func CreateDirRecursively(dirToCreate string, permissions os.FileMode, owner, group int, backupOriginal bool) error
CreateDirRecursively gets path to directories tree , permissions , UID and GID and a boolean value telling whether we should backup existing tree in case of necessity Creates the whole tree Returns error or nil
func FindAndReplace ¶
func FindAndReplace(srcFile, dstFile, oldPattern, newPattern string, filePermissions os.FileMode) error
FindAndReplace is looking for appropriate pattern in the file and replace it with a new one Could be also applied for generating a new file
func FindAndReplaceMulti ¶
func FindAndReplaceMulti(srcFile, dstFile string, patternMap map[string]string, filePermissions os.FileMode) error
FindAndReplaceMulti is looking for appropriate patterns in the file and replace them with new patterns The patterns must be represented as a map where key is the old pattern and value is a new one Could be also applied for generating a new file
func RemoveIfExists ¶
RemoveIfExists cleans up appropriate stuff It gets a single path or multiple paths and boolean value telling if an error shall be thrown Returns error or nil
Types ¶
This section is empty.