Documentation
¶
Index ¶
Constants ¶
const ErrNoOutputsFound = Error("There are no existing files according to the provided input and output suffixes.")
Variables ¶
This section is empty.
Functions ¶
func CorrectPerms ¶
CorrectPerms checks whether the given file has the same ownership and read-write permissions as the given destDir info. If permissions do not match, they will be changed accordingly.
func DeleteAllPrefixedDirEntries ¶
DeleteAllPrefixedDirEntries deletes all files and directories in the given directory that have the given prefix.
func MergeDGUTADBDirectories ¶ added in v5.1.0
MergeDGUTADBDirectories copies the dguta.db numbered subdirectories from inside sourceDir to inside destDir, renaming them so they don't conflict with existing destDir subdirectories.
Types ¶
type Tidy ¶
type Tidy struct { SrcDir string DestDir string // Date used in the renaming of files. Date string // File suffixes of combine files in the SrcDir, and their counterpart in // the destDir. CombineFileSuffixes map[string]string // File suffixes of db files in the SrcDir, and their counterpart in the // destDir. DBFileSuffixes map[string]string // File suffixes of base files in the SrcDir, and their counterpart in the // destDir. BaseFileSuffixes map[string]string // Glob pattern describing the path of combine files in SrcDir. CombineFileGlobPattern string // Glob pattern describing the path of db files in SrcDir. DBFileGlobPattern string // Glob pattern describing the path of walk files in SrcDir. WalkFilePathGlobPattern string // The perms of destdir if we make the destdir ourselves. DestDirPerms fs.FileMode // contains filtered or unexported fields }
Up struct defines your source directory, suffixes and glob patterns to find input files, and information about your destination directory, so that Up() can tidy your source files to the DestDir.
func (*Tidy) Up ¶
Up takes our source directory of wrstat output files, renames them and relocates them to our dest directory, using our date. Also ensures that the permissions of wrstat output files match those of dest directory. If our dest dir doesn't exist, it will be created. And it touches a file called .dguta.db.updated, setting its mTime equal to the oldest of all those from our srcDir. Finally, deletes the source directory.
For debugging purposes, set disableDeletion to true to disable deletion of the source directory after a successful move.