22 lines
600 B
Plaintext
Raw Permalink Normal View History

{-# GLOBALOPTIONS -package mtl #-}
2005-04-24 08:51:33 +00:00
-- illustrates the use of static options in pragmas
import System.IO.Unsafe
import System.IO
import System.Process
resource = unsafe { field = date }
-- illustrates the use of the devil's work
date :: String
date = unsafePerformIO $ do
#if !defined(CYGWIN) || !defined(__MINGW32__)
2005-04-24 08:51:33 +00:00
(_,outh,_,proc) <- runInteractiveProcess "date" [] Nothing Nothing
#else
(_,outh,_,proc) <- runInteractiveProcess "@PREFIX@/../../bin/date" [] Nothing Nothing
#endif
2005-04-24 08:51:33 +00:00
waitForProcess proc
s <- hGetContents outh
return s