MCPcopy Index your code
hub / github.com/codeyourweb/irma / ListTemporaryFiles

Function ListTemporaryFiles

filehelper.go:90–116  ·  view source on GitHub ↗

ListTemporaryFiles list all files in TEMP / TMP / %SystemRoot%\Temp

(verbose bool)

Source from the content-addressed store, hash-verified

88
89// ListTemporaryFiles list all files in TEMP / TMP / %SystemRoot%\Temp
90func ListTemporaryFiles(verbose bool) (files []string) {
91
92 var folders = []string{os.Getenv("TEMP")}
93 if os.Getenv("TMP") != os.Getenv("TEMP") {
94 folders = append(folders, os.Getenv("TMP"))
95 }
96
97 if os.Getenv("SystemRoot")+`\Temp` != os.Getenv("TEMP") {
98 folders = append(folders, os.Getenv("SystemRoot")+`\Temp`)
99 }
100
101 for _, p := range folders {
102 f, err := RetrivesFilesFromUserPath(p, true, defaultScannedFileExtensions, true, verbose)
103 if err != nil {
104 if verbose {
105 logMessage(LOG_INFO, err)
106 }
107 continue
108 }
109
110 for _, i := range f {
111 files = append(files, i)
112 }
113 }
114
115 return files
116}
117
118// FormatPathFromComplexString search for file/directory path and remove environments variables, quotes and extra parameters
119func FormatPathFromComplexString(command string) (paths []string) {

Callers 1

Calls 2

logMessageFunction · 0.85

Tested by

no test coverage detected