时间戳 文件传输 支持

This commit is contained in:
jixishi
2024-05-30 15:56:52 +08:00
parent 68f285b5ed
commit 82ec65958e
7 changed files with 126 additions and 37 deletions
+13
View File
@@ -3,6 +3,7 @@ package main
import (
"log"
"net"
"os"
)
type Config struct {
@@ -18,6 +19,8 @@ type Config struct {
logFilePath string
forWard int
frameSize int
timesTamp bool
timesFmt string
address string
}
type FoeWardMode int
@@ -49,3 +52,13 @@ func setForWardClient() (conn net.Conn) {
}
return conn
}
func checkLogOpen() {
if config.enableLog {
f, err := os.OpenFile(config.logFilePath, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)
if err != nil {
log.Fatal(err)
}
outs = append(outs, f)
}
}