
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

Hi Vasili, Vasili I. Galchin wrote:
[snip]
import System.Process
main = do handle <- runProcess "blastall" -- executable ["-p blastn"] -- CLI args
Try: ["-p", "blastn"] This passes multiple command line arguments instead of just one that contains a space. Most shells use spaces to separate arguments.
[snip]
Hope this helps, Claude -- http://claudiusmaximus.goto10.org

On Mon, Apr 27, 2009 at 06:00:52PM -0500, Vasili I. Galchin wrote:
I feel that it has something to do with double quotes in Haskell ... probably something obviously silly that I am doing.
The problem is that ["-p blastn"] means that there's only one argument, while ["-p", "blastn"] means what you want. In a Unix shell, what you're doing is the same as 'blastn "-p blastn"', which is clearly wrong. Why are things like this? Well, imagine that you wanted to pass a file as argument, and that file had a space in its name. Having a list of arguments leaves you unconcerned about these subtleties. -- Felipe.
participants (3)
-
Claude Heiland-Allen
-
Felipe Lessa
-
Vasili I. Galchin