
Hello, I am trying to use createProcess. Following is a small fragment. I am trying to run a program called blastall (a bio-informatics program). It is kind of like mv/cp/ln on Unix platforms (where the executable examines the program, i.e. arg[0], and then provides appropriate behavior/semantics). In the case of blastall, it alters its behavior based on the -p(program) CLI argument.WSo in the following it should provide nucleotide behavior ... that is what the 'n' on the end of blastn means. import System.Process main = do handle <- runProcess "blastall" -- executable ["-p blastn"] -- CLI args Nothing -- optional cwd Nothing -- optional env Nothing -- optional stdin Nothing -- optional stdout Nothing -- optional stderr return () When I run this program with ghci, blastall is not a happy camper. It is complaining about "-p blastn": [NULL_Caption] ERROR: Program name undefined: " blastn" <<< the space between the double quote and 'b' is really there!!! [NULL_Caption] ERROR: Program name undefined: " blastn" Yet if I run 'blastall -p blastn' from the DOS prompt no errors(I will try tonight on my Linux machine). If I try 'blastall -p bozo" from the DOS prompt I get the same two errors as when I run my test program using ghci. I feel that it has something to do with double quotes in Haskell ... probably something obviously silly that I am doing. Any ideas? Kind regards, Vasili

On Apr 27, 2009, at 18:55 , Vasili I. Galchin wrote:
["-p blastn"] -- CLI args
createProcess expects a list of individual argument strings. You're sending it a single argument ["-p blastn"]; you want to send it two arguments ["-p", "blastn"] (or ["-pblastn"] without the space; like most commands you can combine the parameter with the option or pass it as the next argument). The command line equivalent of what you're doing would be: blastall '- p blastn' -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH
participants (2)
-
Brandon S. Allbery KF8NH
-
Vasili I. Galchin