mirror of
https://github.com/rwinkhart/rcw.git
synced 2026-09-05 16:47:24 -04:00
Add high-level function for calling the daemon if it is open
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user