diff --git a/cmd/all/all.go b/cmd/all/all.go index db92cee..3efe5ae 100644 --- a/cmd/all/all.go +++ b/cmd/all/all.go @@ -74,7 +74,7 @@ func RunBatch(net *net.IPNet) { func printResult(records define.Records) { if command.Opts.OutputFile != "" { - f, err := os.OpenFile(command.Opts.OutputFile, os.O_CREATE|os.O_WRONLY, 0644) + f, err := os.OpenFile(command.Opts.OutputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { log.Warnf("OpenFile failed: %v", err) } diff --git a/cmd/axfr/axfr.go b/cmd/axfr/axfr.go index 7539a36..5ba568b 100644 --- a/cmd/axfr/axfr.go +++ b/cmd/axfr/axfr.go @@ -42,7 +42,7 @@ var AxfrCmd = &cobra.Command{ return } if command.Opts.OutputFile != "" { - f, err := os.OpenFile(command.Opts.OutputFile, os.O_CREATE|os.O_WRONLY, 0644) + f, err := os.OpenFile(command.Opts.OutputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { log.Warnf("OpenFile failed: %v", err) } diff --git a/cmd/service/service.go b/cmd/service/service.go index 953af2b..cc40416 100644 --- a/cmd/service/service.go +++ b/cmd/service/service.go @@ -29,7 +29,7 @@ var ServiceCmd = &cobra.Command{ } records = scanner.ScanSvcForPorts(records) if command.Opts.OutputFile != "" { - f, err := os.OpenFile(command.Opts.OutputFile, os.O_CREATE|os.O_WRONLY, 0644) + f, err := os.OpenFile(command.Opts.OutputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { log.Warnf("OpenFile failed: %v", err) } diff --git a/cmd/subnet/subnet.go b/cmd/subnet/subnet.go index cf0a5ea..16afd29 100644 --- a/cmd/subnet/subnet.go +++ b/cmd/subnet/subnet.go @@ -62,7 +62,7 @@ func BatchRun(net *net.IPNet) { func printResult(records define.Records) { if command.Opts.OutputFile != "" { - f, err := os.OpenFile(command.Opts.OutputFile, os.O_CREATE|os.O_WRONLY, 0644) + f, err := os.OpenFile(command.Opts.OutputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { log.Warnf("OpenFile failed: %v", err) } diff --git a/cmd/wildcard/wildcard.go b/cmd/wildcard/wildcard.go index 97f243c..8ba4884 100644 --- a/cmd/wildcard/wildcard.go +++ b/cmd/wildcard/wildcard.go @@ -28,7 +28,7 @@ var WildCardCmd = &cobra.Command{ func printResult(records define.Records) { if command.Opts.OutputFile != "" { - f, err := os.OpenFile(command.Opts.OutputFile, os.O_CREATE|os.O_WRONLY, 0644) + f, err := os.OpenFile(command.Opts.OutputFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { log.Warnf("OpenFile failed: %v", err) }