Get general concept for backup resotration using a unified interface implemented

This commit is contained in:
Dane Everitt
2021-01-18 21:20:58 -08:00
parent 66b6f40b61
commit 6ef0bd7496
7 changed files with 179 additions and 49 deletions

View File

@@ -115,12 +115,10 @@ func (fs *Filesystem) DecompressFile(dir string, file string) error {
return err
}
// Walk over all of the files spinning up an additional go-routine for each file we've encountered
// and then extract that file from the archive and write it to the disk. If any part of this process
// encounters an error the entire process will be stopped.
// Walk all of the files in the archiver file and write them to the disk. If any
// directory is encountered it will be skipped since we handle creating any missing
// directories automatically when writing files.
err = archiver.Walk(source, func(f archiver.File) error {
// Don't waste time with directories, we don't need to create them if they have no contents, and
// we will ensure the directory exists when opening the file for writing anyways.
if f.IsDir() {
return nil
}