Skip to content

Commit

Permalink
fix file error name condition
Browse files Browse the repository at this point in the history
  • Loading branch information
肖潇 authored and 肖潇 committed Nov 24, 2022
1 parent 1ad2e32 commit b5a368b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
Binary file modified batch-shovill-linux-amd64
Binary file not shown.
Binary file modified batch-shovill-mac-amd64
Binary file not shown.
Binary file modified batch-shovill-windows-amd64
Binary file not shown.
3 changes: 2 additions & 1 deletion logfile.log
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
2021/05/29 22:27:43 shovill --trim --outdir /Users/xiao/go/src/gyy-shovill/out/A111 --force --R1 /Users/xiao/go/src/gyy-shovill/data/A111_1 --R2 /Users/xiao/go/src/gyy-shovill/data/A111_2
2022/11/24 09:40:26 shovill --trim --outdir /Users/xiao/Code/githubRepo/batch-shovill-assemblies/out/A111 --force --R1 /Users/xiao/Code/githubRepo/batch-shovill-assemblies/data/A111_1 --R2 /Users/xiao/Code/githubRepo/batch-shovill-assemblies/data/A111_2 2022/11/24 09:40:47 shovill --trim --outdir /Users/xiao/Code/githubRepo/batch-shovill-assemblies/out/A111 --force --R1 /Users/xiao/Code/githubRepo/batch-shovill-assemblies/data/A111_1 --R2 /Users/xiao/Code/githubRepo/batch-shovill-assemblies/data/A111_2
2022/11/24 09:40:47 shovill --trim --outdir /Users/xiao/Code/githubRepo/batch-shovill-assemblies/out/A111 --force --R1 /Users/xiao/Code/githubRepo/batch-shovill-assemblies/data/A111_1 --R2 /Users/xiao/Code/githubRepo/batch-shovill-assemblies/data/A111_2
7 changes: 5 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func main() {

if os.IsNotExist(err) {
ret := getGenArray(outPutDirSeg, files)
if len(ret) != 2 {
continue
}
file1 := ret[0]
file2 := ret[1]

Expand Down Expand Up @@ -125,7 +128,7 @@ func logger(logthis string) {
}

}
file, err := os.OpenFile(filePath, os.O_WRONLY | os.O_TRUNC, 0666)
file, err := os.OpenFile(filePath, os.O_WRONLY | os.O_APPEND, 0666)
// file, err := os.OpenFile(filePath, os.O_WRONLY | os.O_APPEND, 0666)
if err != nil {
fmt.Printf("open file err=%v\n", err)
Expand All @@ -136,7 +139,7 @@ func logger(logthis string) {

now := time.Now()
time := now.Format("2006/01/02 15:04:05")
str := fmt.Sprintf("%v %v ", time, logthis)
str := fmt.Sprintf("%v %v \n", time, logthis)
writer := bufio.NewWriter(file)
writer.WriteString(str)

Expand Down

0 comments on commit b5a368b

Please sign in to comment.