MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / checkFolder

Function checkFolder

src/toolchain.go:28–50  ·  view source on GitHub ↗

--- System Tools --- Checks if the folder exists, if not, the folder is created

(path string)

Source from the content-addressed store, hash-verified

26
27// Checks if the folder exists, if not, the folder is created
28func checkFolder(path string) (err error) {
29
30 var debug string
31 _, err = os.Stat(filepath.Dir(path))
32
33 if os.IsNotExist(err) {
34 // Ordner existiert nicht, wird jetzt erstellt
35
36 err = os.MkdirAll(getPlatformPath(path), 0755)
37 if err == nil {
38
39 debug = fmt.Sprintf("Create Folder:%s", path)
40 showDebug(debug, 1)
41
42 } else {
43 return err
44 }
45
46 return nil
47 }
48
49 return nil
50}
51
52// checkVFSFolder : Checks whether the Folder exists in provided virtual filesystem, if not, the Folder is created
53func checkVFSFolder(path string, vfs avfs.VFS) (err error) {

Callers 6

ThreadfinAutoBackupFunction · 0.85
ThreadfinBackupFunction · 0.85
ThreadfinRestoreFunction · 0.85
InitFunction · 0.85
updateServerSettingsFunction · 0.85
createSystemFoldersFunction · 0.85

Calls 2

showDebugFunction · 0.85
getPlatformPathFunction · 0.70

Tested by

no test coverage detected