This commit is contained in:
parent
107b499f1a
commit
280b665b86
|
@ -393,28 +393,30 @@ func createFile(path, fileType string) bool {
|
||||||
case "f":
|
case "f":
|
||||||
file, err := os.OpenFile(path, os.O_CREATE, 0664)
|
file, err := os.OpenFile(path, os.O_CREATE, 0664)
|
||||||
if nil != err {
|
if nil != err {
|
||||||
glog.Info(err)
|
glog.Error(err)
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
glog.Infof("Created file [%s]", path)
|
glog.V(5).Infof("Created file [%s]", path)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
case "d":
|
case "d":
|
||||||
err := os.Mkdir(path, 0775)
|
err := os.Mkdir(path, 0775)
|
||||||
|
|
||||||
if nil != err {
|
if nil != err {
|
||||||
glog.Info(err)
|
glog.Error(err)
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
glog.Infof("Created directory [%s]", path)
|
glog.V(5).Infof("Created directory [%s]", path)
|
||||||
|
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
glog.Infof("Unsupported file type [%s]", fileType)
|
glog.Errorf("Unsupported file type [%s]", fileType)
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue