summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Plugins/Monitors/Common.hs')
-rw-r--r--Plugins/Monitors/Common.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Plugins/Monitors/Common.hs b/Plugins/Monitors/Common.hs
index 779c6f4..caf2e98 100644
--- a/Plugins/Monitors/Common.hs
+++ b/Plugins/Monitors/Common.hs
@@ -43,6 +43,7 @@ module Plugins.Monitors.Common (
-- * Threaded Actions
-- $thread
, doActionTwiceWithDelay
+ , catRead
) where
@@ -56,6 +57,7 @@ import Numeric
import Text.ParserCombinators.Parsec
import System.Console.GetOpt
import Control.Exception (SomeException,handle)
+import System.Process(readProcess)
import Plugins
-- $monitor
@@ -306,3 +308,6 @@ getData action var d =
do threadDelay d
s <- action
modifyMVar_ var (\_ -> return $! s)
+
+catRead :: FilePath -> IO B.ByteString
+catRead file = B.pack `fmap` readProcess "/bin/cat" [file] ""