Files
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

18 lines
299 B
Go

//go:build linux || darwin || freebsd || netbsd || openbsd || dragonfly
package memory
import (
"os"
"golang.org/x/sys/unix"
)
func lockFile(f *os.File, exclusive bool) error {
flag := unix.LOCK_SH
if exclusive {
flag = unix.LOCK_EX
}
return unix.Flock(int(f.Fd()), flag|unix.LOCK_NB)
}