2005-04-24 08:51:33 +00:00
|
|
|
{-# OPTIONS -cpp #-}
|
|
|
|
--
|
|
|
|
-- Copyright (c) 2004 Don Stewart - http://www.cse.unsw.edu.au/~dons
|
|
|
|
-- LGPL version 2.1 or later (see http://www.gnu.org/copyleft/lesser.html)
|
|
|
|
--
|
|
|
|
|
|
|
|
import System.IO
|
2005-05-13 01:58:07 +00:00
|
|
|
import System.Process
|
2005-04-24 08:51:33 +00:00
|
|
|
|
|
|
|
resource = testio { field = date }
|
|
|
|
|
|
|
|
--
|
|
|
|
-- call a shell command , returning it's output
|
|
|
|
--
|
|
|
|
date :: IO String
|
2005-05-21 11:23:18 +00:00
|
|
|
date = do
|
|
|
|
#if !defined(CYGWIN) || !defined(__MINGW32__)
|
|
|
|
(_,out,_,_) <- catch (runInteractiveCommand "/bin/date") (\_->error "popen failed")
|
|
|
|
#else
|
|
|
|
(_,out,_,_) <- catch (runInteractiveCommand "@PREFIX@/../../bin/date") (\_->error "popen failed")
|
|
|
|
#endif
|
2005-05-13 01:58:07 +00:00
|
|
|
hGetLine out
|