Windows: fileutil.TryLockFile panic
tadev opened this issue · comments
On windows, fileutil fails to lock the file using os.O_RDWR|os.O_CREATE (66)
running, it may take a few minutes...
panic: flag 66 is not supported
goroutine 104 [running]:
github.com/fanpei91/torsniff/vendor/go.etcd.io/etcd/pkg/fileutil.open(0xc0001d21e0, 0x47, 0x42, 0xc0000001ed, 0x0, 0x0, 0x0)
H:/GoWork/src/github.com/fanpei91/torsniff/vendor/go.etcd.io/etcd/pkg/fileutil/lock_windows.go:82 +0x31c
github.com/fanpei91/torsniff/vendor/go.etcd.io/etcd/pkg/fileutil.TryLockFile(0xc0001d21e0, 0x47, 0x42, 0x1ed, 0x0, 0xc0003e18c0, 0x16)
H:/GoWork/src/github.com/fanpei91/torsniff/vendor/go.etcd.io/etcd/pkg/fileutil/lock_windows.go:44 +0x52
main.(*torsniff).saveTorrent(0xc00008e190, 0xc00000e420, 0x28, 0xc000368000, 0xea23, 0xea23, 0x0, 0x0)
H:/GoWork/src/github.com/fanpei91/torsniff/torsniff.go:206 +0x154
main.(*torsniff).work(0xc00008e190, 0xc0001581c0, 0xc00004e120)
H:/GoWork/src/github.com/fanpei91/torsniff/torsniff.go:174 +0x1f5
created by main.(*torsniff).run
H:/GoWork/src/github.com/fanpei91/torsniff/torsniff.go:138 +0x145
It works fine using os.OpenFile