Limit number of simultaneous file extractions to prevent hardlock

Added helper extraction functions
chmod & chown is now set after a folder's extraction to prevent permission issues
This commit is contained in:
Caleb Gardner
2023-04-17 10:22:10 -05:00
parent 2ba4551fb9
commit d2c72f9464
5 changed files with 118 additions and 21 deletions
+8 -2
View File
@@ -18,7 +18,7 @@ import (
)
const (
squashfsURL = "https://darkstorm.tech/LinuxPATest.sfs"
squashfsURL = "https://darkstorm.tech/files/LinuxPATest.sfs"
squashfsName = "LinuxPATest.sfs"
filePath = "PortableApps/Notepad++Portable/App/DefaultData/Config/contextMenu.xml"
@@ -122,7 +122,13 @@ func TestExtractQuick(t *testing.T) {
if err != nil {
t.Fatal(err)
}
err = rdr.ExtractWithOptions(libPath, &squashfs.ExtractionOptions{Verbose: true})
os.RemoveAll(filepath.Join(tmpDir, "testLog.txt"))
logFil, _ := os.Create(filepath.Join(tmpDir, "testLog.txt"))
op := squashfs.DefaultOptions()
op.Verbose = true
op.IgnorePerm = true
op.LogOutput = logFil
err = rdr.ExtractWithOptions(libPath, op)
if err != nil {
t.Fatal(err)
}