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.
17 lines
333 B
Go
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)
|
|
}
|