Commit 1fe10cbe by huangchengyi

1.0

parent c0158858
Showing with 2 additions and 1 deletions
...@@ -39,7 +39,7 @@ func Log(writeString string,log_file_pre string,types int) { ...@@ -39,7 +39,7 @@ func Log(writeString string,log_file_pre string,types int) {
var f *os.File var f *os.File
var err1 error var err1 error
if checkFileIsExist(filename) { //如果文件存在 if checkFileIsExist(filename) { //如果文件存在
f, err1 = os.OpenFile(filename, os.O_APPEND, 0666) //打开文件 f, err1 = os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE,0755)
} else { } else {
f, err1 = os.Create(filename) //创建文件 f, err1 = os.Create(filename) //创建文件
} }
...@@ -49,6 +49,7 @@ func Log(writeString string,log_file_pre string,types int) { ...@@ -49,6 +49,7 @@ func Log(writeString string,log_file_pre string,types int) {
if types == 1 { if types == 1 {
fmt.Print(writeString) fmt.Print(writeString)
} }
defer f.Close()
//fmt.Print(err) //fmt.Print(err)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment