Move "daemonIsOpen" to "2server.go"

This commit is contained in:
2025-04-13 18:01:24 -04:00
parent dc262c87e8
commit 9458656bdd
2 changed files with 10 additions and 12 deletions
+10
View File
@@ -26,3 +26,13 @@ func getFileHash(path string) []byte {
io.Copy(hash, file)
return hash.Sum(nil)
}
// 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()
}
-12
View File
@@ -1,12 +0,0 @@
package daemon
import "os"
func daemonIsOpen() bool {
// check if socketPath exists and is a file
fileInfo, err := os.Stat(socketPath)
if err != nil {
return false
}
return !fileInfo.IsDir()
}