parent
e753b5b159
commit
d622e74c51
10
main.go
10
main.go
@ -20,6 +20,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
gClientId int
|
||||||
gLastDirPath string
|
gLastDirPath string
|
||||||
gSelectionPath string
|
gSelectionPath string
|
||||||
gSocketPath string
|
gSocketPath string
|
||||||
@ -50,8 +51,13 @@ func init() {
|
|||||||
|
|
||||||
gSocketPath = filepath.Join(tmp, fmt.Sprintf("lf.%s.sock", envUser))
|
gSocketPath = filepath.Join(tmp, fmt.Sprintf("lf.%s.sock", envUser))
|
||||||
|
|
||||||
// TODO: unique log file for each client
|
gClientId = 1000
|
||||||
gLogPath = filepath.Join(tmp, fmt.Sprintf("lf.%s.log", envUser))
|
gLogPath = filepath.Join(tmp, fmt.Sprintf("lf.%s.%d.log", envUser, gClientId))
|
||||||
|
for _, err := os.Stat(gLogPath); err == nil; _, err = os.Stat(gLogPath) {
|
||||||
|
gClientId++
|
||||||
|
gLogPath = filepath.Join(tmp, fmt.Sprintf("lf.%s.%d.log", envUser, gClientId))
|
||||||
|
}
|
||||||
|
|
||||||
gServerLogPath = filepath.Join(tmp, fmt.Sprintf("lf.%s.server.log", envUser))
|
gServerLogPath = filepath.Join(tmp, fmt.Sprintf("lf.%s.server.log", envUser))
|
||||||
|
|
||||||
gConfigPath = filepath.Join(envConfig, "lf", "lfrc")
|
gConfigPath = filepath.Join(envConfig, "lf", "lfrc")
|
||||||
|
Loading…
Reference in New Issue
Block a user