]> 127.0.0.1 Git - part/.git/commitdiff
46
authorqydysky <qydysky@foxmail.com>
Thu, 13 Aug 2020 10:04:03 +0000 (18:04 +0800)
committerqydysky <qydysky@foxmail.com>
Thu, 13 Aug 2020 10:04:03 +0000 (18:04 +0800)
Sys.go

diff --git a/Sys.go b/Sys.go
index f53d6e7685747e0c3f79b16455efe2f6facbef50..b8b0dd4b9375fc0d15d47341e551e875c52973a4 100644 (file)
--- 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()