mirror of
https://github.com/rwinkhart/rcw.git
synced 2026-08-27 20:36:30 -04:00
18 lines
315 B
Go
18 lines
315 B
Go
package daemon
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
var binPath, _ = os.Executable() // store binary path
|
|
|
|
// IsOpen checks if the socket/named pipe for the rcw
|
|
// daemon exists and returns a boolean indicator.
|
|
func IsOpen() bool {
|
|
fileInfo, err := os.Stat(socketPath)
|
|
if err != nil {
|
|
return false
|
|
}
|
|
return !fileInfo.IsDir()
|
|
}
|