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