Add high-level function for calling the daemon if it is open

This commit is contained in:
2025-05-04 19:38:45 -04:00
parent 0479447f14
commit 9314852f06
6 changed files with 36 additions and 39 deletions
+10
View File
@@ -5,3 +5,13 @@ import (
)
var binPath, _ = os.Executable() // store binary path
// daemonIsOpen checks if the socket/named pipe for the rcw
// daemon exists and returns a boolean indicator.
func daemonIsOpen() bool {
fileInfo, err := os.Stat(socketPath)
if err != nil {
return false
}
return !fileInfo.IsDir()
}