scanner

package
v0.0.0-...-fab78a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2025 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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

func CheckFileExist(fpath string) bool

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

func RemoveFile(file string) (bool, error)

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

func SecureRemove(file string) (bool, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL