mirror of
https://github.com/rwinkhart/rcw.git
synced 2026-10-29 06:58:15 -04:00
Add high-level function for calling the daemon if it is open
This commit is contained in:
1 parent
0479447f14
commit
9314852f06
6 files changed
+36
-39
No files matched your search
@@ -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