From d9ae9354c9d78a41b26fc36659cad7101c79fd7c Mon Sep 17 00:00:00 2001 From: qydysky Date: Thu, 13 Aug 2020 18:04:03 +0800 Subject: [PATCH] 46 --- Sys.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sys.go b/Sys.go index f53d6e7..b8b0dd4 100644 --- a/Sys.go +++ b/Sys.go @@ -8,6 +8,7 @@ import ( "time" "net" "strconv" + "strings" "io/ioutil" "errors" @@ -31,6 +32,14 @@ func (this *sys) Cdir()string{ return exPath } +func (t *sys) Pdir(cdir string) string{ + if t.GetSys("windwos") { + return cdir[:strings.LastIndex(cdir, "\\")] + }else{ + return cdir[:strings.LastIndex(cdir, "/")] + } +} + func (this *sys) Timeoutf(Timeout int) { this.Lock() defer this.Unlock() -- 2.39.2