--- System Tools --- Checks if the folder exists, if not, the folder is created
(path string)
| 26 | |
| 27 | // Checks if the folder exists, if not, the folder is created |
| 28 | func 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 |
| 53 | func checkVFSFolder(path string, vfs avfs.VFS) (err error) { |
no test coverage detected