Files
picoclaw/pkg/memory/lease_windows.go
loveuer b8b11d452f feat: store PicoClaw memory in SQLite
Store session history, preferences, and dated records in one database per home.
Commit complete turns, checkpoint tool batches, and compact history by prefix.
Add memory search and writes, with previews for ambiguous corrections.
Review conversations in the background and support SQLite backup and restore.
2026-11-25 11:36:10 +08:00

17 lines
333 B
Go

package memory
import (
"os"
"golang.org/x/sys/windows"
)
func lockFile(f *os.File, exclusive bool) error {
flag := uint32(windows.LOCKFILE_FAIL_IMMEDIATELY)
if exclusive {
flag |= windows.LOCKFILE_EXCLUSIVE_LOCK
}
var offset windows.Overlapped
return windows.LockFileEx(windows.Handle(f.Fd()), flag, 0, 1, 0, &offset)
}