Commit 113d5a86 authored by Michael Hanus 's avatar Michael Hanus
Browse files

Stub implementation for curry2go inserted, re-export of Data.IORef removed

parent 2c6cfa93
{ {
"name": "io-extra", "name": "io-extra",
"version": "3.0.0", "version": "3.0.0",
"author": "Michael Hanus <mh@informatik.uni-kiel.de>", "author": "Michael Hanus <mh@informatik.uni-kiel.de>",
"synopsis": "Library with some useful extensions to the IO monad.", "synopsis": "Library with some useful extensions to the IO monad.",
"category": [ "IO" ], "category": [ "IO" ],
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"licenseFile": "LICENSE", "licenseFile": "LICENSE",
"dependencies": { "dependencies": {
"base": ">= 3.0.0, < 4.0.0", "base": ">= 3.0.0, < 4.0.0",
"process": ">= 3.0.0, < 4.0.0", "process": ">= 3.0.0, < 4.0.0",
"directory":">= 3.0.0, < 4.0.0" "directory":">= 3.0.0, < 4.0.0"
}, },
"compilerCompatibility": { "compilerCompatibility": {
"pakcs": ">= 3.0.0, < 4.0.0", "pakcs" : ">= 3.0.0, < 4.0.0",
"kics2": ">= 3.0.0, < 4.0.0" "kics2" : ">= 3.0.0, < 4.0.0",
}, "curry2go": ">= 1.0.0"
},
"exportedModules": [ "exportedModules": [
"System.IOExts" "System.IOExts"
], ],
"testsuite": { "testsuite": {
"src-dir": "test", "src-dir": "test",
"modules": [ "TestConnect" ] "modules": [ "TestConnect" ]
......
...@@ -11,18 +11,16 @@ module System.IOExts ...@@ -11,18 +11,16 @@ module System.IOExts
execCmd, evalCmd, connectToCommand execCmd, evalCmd, connectToCommand
-- file access -- file access
, readCompleteFile,updateFile, exclusiveIO , readCompleteFile,updateFile, exclusiveIO
-- IORef
, IORef, newIORef, readIORef, writeIORef, modifyIORef
) where ) where
#ifdef __PAKCS__ import Control.Monad ( unless )
import Data.Char (isAlphaNum) #ifdef __KICS2__
import System.Directory (removeFile) #else
import Data.Char ( isAlphaNum )
import System.Directory ( removeFile )
#endif #endif
import System.IO import System.IO
import System.Process import System.Process
import Data.IORef
import Control.Monad
--- Executes a command with a new default shell process. --- Executes a command with a new default shell process.
--- The standard I/O streams of the new process (stdin,stdout,stderr) --- The standard I/O streams of the new process (stdin,stdout,stderr)
...@@ -46,7 +44,12 @@ prim_execCmd external ...@@ -46,7 +44,12 @@ prim_execCmd external
--- @param input - the input to be written to the command's stdin --- @param input - the input to be written to the command's stdin
--- @return the exit code and the contents written to stdout and stderr --- @return the exit code and the contents written to stdout and stderr
evalCmd :: String -> [String] -> String -> IO (Int, String, String) evalCmd :: String -> [String] -> String -> IO (Int, String, String)
#ifdef __PAKCS__ #ifdef __KICS2__
evalCmd cmd args input = ((prim_evalCmd $## cmd) $## args) $## input
prim_evalCmd :: String -> [String] -> String -> IO (Int, String, String)
prim_evalCmd external
#else
evalCmd cmd args input = do evalCmd cmd args input = do
pid <- getPID pid <- getPID
let tmpfile = "/tmp/PAKCS_evalCMD"++show pid let tmpfile = "/tmp/PAKCS_evalCMD"++show pid
...@@ -81,11 +84,6 @@ evalCmd cmd args input = do ...@@ -81,11 +84,6 @@ evalCmd cmd args input = do
else do c <- hGetChar h else do c <- hGetChar h
cs <- hGetEOF h cs <- hGetEOF h
return (c:cs) return (c:cs)
#else
evalCmd cmd args input = ((prim_evalCmd $## cmd) $## args) $## input
prim_evalCmd :: String -> [String] -> String -> IO (Int, String, String)
prim_evalCmd external
#endif #endif
......
package SystemIOExts
import "gocurry"
func ExternalSystem_IOExts_prim_execCmd(task *gocurry.Task){
panic("System.IOExts.execCmd: not yet implemented")
}
func ExternalSystem_IOExts_prim_connectToCmd(task *gocurry.Task){
panic("System.IOExts.connectToCmd: not yet implemented")
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment