This commit is contained in:
Liang Ding 2014-10-26 15:59:12 +08:00
parent 107b499f1a
commit 280b665b86
1 changed files with 7 additions and 5 deletions

View File

@ -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
}