MCPcopy Create free account
hub / github.com/JordanCoin/codemap / ReadPID

Function ReadPID

watch/state.go:55–64  ·  view source on GitHub ↗

ReadPID reads the daemon PID from .codemap/watch.pid

(root string)

Source from the content-addressed store, hash-verified

53
54// ReadPID reads the daemon PID from .codemap/watch.pid
55func ReadPID(root string) (int, error) {
56 pidFile := filepath.Join(root, ".codemap", "watch.pid")
57 data, err := os.ReadFile(pidFile)
58 if err != nil {
59 return 0, err
60 }
61 var pid int
62 _, err = fmt.Sscanf(string(data), "%d", &pid)
63 return pid, err
64}
65
66// RemovePID removes the PID file
67func RemovePID(root string) {

Callers 5

IsOwnedDaemonFunction · 0.85
IsRunningFunction · 0.85
StopFunction · 0.85

Calls

no outgoing calls

Tested by 2