Documentation ¶
Index ¶
- func AppendCsv(fpath, line string)
- func CheckExtensions(checkvideo, checkother bool, pathcfg *config.PathsConfig, ext string) (bool, bool)
- func CheckFileExist(fpath string) bool
- func MoveFile(file string, setpathcfg *config.PathsConfig, target, newname string, ...) (string, error)
- func RemoveFile(file string) (bool, error)
- func SecureRemove(file string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendCsv ¶
func AppendCsv(fpath, line string)
AppendCsv appends a line to the CSV file at fpath. It opens the file for appending, creating it if needed, with permissions 0777. It writes the line to the file with a newline separator. It handles logging and returning any errors.
func CheckExtensions ¶
func CheckExtensions(checkvideo, checkother bool, pathcfg *config.PathsConfig, ext string) (bool, bool)
CheckExtensions checks if the given file extension is allowed for the provided checkvideo and checkother booleans. It returns a bool for if the extension is allowed, and a bool for if renaming should be skipped.
func CheckFileExist ¶
CheckFileExist checks if the file exists at the given file path. It returns true if the file exists, and false if there is an error indicating the file does not exist.
func MoveFile ¶
func MoveFile(file string, setpathcfg *config.PathsConfig, target, newname string, useother, usenil, usebuffercopy bool, chmodfolder, chmod string) (string, error)
MoveFile moves a file from one path to another. It handles checking extensions, renaming, setting permissions etc. It returns a bool indicating if the move was successful, and an error.
func RemoveFile ¶
RemoveFile removes the file at the given path if it exists. It checks if the file exists first before removing. Returns a bool indicating if the file was removed, and an error if one occurred.
func SecureRemove ¶
SecureRemove attempts to remove the file at the given path. If the file cannot be removed due to a permissions error, it first attempts to change the file permissions to 0777 and then remove the file. If the file is successfully removed, it logs an informational message. If the file cannot be removed, it logs an error message and returns the error.
Types ¶
This section is empty.