From: qydysky Date: Mon, 27 Jul 2020 23:32:21 +0000 (+0800) Subject: 10 X-Git-Tag: v0.0.2~78 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=6ae2885a3be0362228c8f2207572901c0042d875;p=part%2F.git 10 --- diff --git a/Lock.go b/Lock.go index c33dcef..9b28540 100644 --- a/Lock.go +++ b/Lock.go @@ -26,7 +26,10 @@ func (l *lock) Start(filePath string) int { if Checkfile().IsOpen(lock_md5Key) {return 2} if !Checkfile().IsExist(filePath) {return 3} - lock_md5Key = ".lock."+filePath + fi, err := os.Stat(filePath) + if err != nil {return 4} + + lock_md5Key = ".lock." + fi.Name() lock_file, _ = os.Create(lock_md5Key) return 0 }