| @@ -3,6 +3,7 @@ package main | |||
| import ( | |||
| "fmt" | |||
| "io/ioutil" | |||
| "log" | |||
| "os" | |||
| "strings" | |||
| @@ -111,3 +112,11 @@ func isFileExist(path string) bool { | |||
| } | |||
| return true | |||
| } | |||
| func ensurePathExist(path string) { | |||
| d := filepath.Dir(path) | |||
| if !isFileExist(d) { | |||
| log.Println("Creating path [" + d + "]") | |||
| os.MkdirAll(d, 0700) | |||
| } | |||
| } | |||