mirror of
https://github.com/ZizzyDizzyMC/linx-server.git
synced 2026-01-23 02:14:33 +00:00
Update localfs.go
This commit is contained in:
parent
b0b2a3c2c1
commit
223db1c714
1 changed files with 13 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package localfs
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
|
|
@ -151,6 +152,18 @@ func (b LocalfsBackend) Unlock(filename string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func (b LocalfsBackend) CheckLock(filename string) (locked bool, err error) {
|
||||
lockPath := path.Join(b.locksPath, filename)
|
||||
|
||||
if _, err := os.Stat(lockPath); errors.Is(err, os.ErrNotExist) {
|
||||
return false, nil
|
||||
} else {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return false, err
|
||||
}
|
||||
|
||||
func (b LocalfsBackend) Put(key string, r io.Reader, expiry time.Time, deleteKey, accessKey string, srcIp string) (m backends.Metadata, err error) {
|
||||
filePath := path.Join(b.filesPath, key)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue