Question

? (run-program "ls" '() :output *standard-output*)
money.lisp
ssqHitNum.txt
ssqNum.txt
#<EXTERNAL-PROCESS (ls)[1019] (EXITED : 0) #x3867BACE>
? (run-program "tail ssqHitNum.txt" '() :output *standard-output*)
#<EXTERNAL-PROCESS (tail ssqHitNum.txt)[1020] (EXITED : 71) #x38679E56>

Why canot CCL run "tail ssqHitNum.txt" ?

Was it helpful?

Solution

As detailed in the docs, http://ccl.clozure.com/ccl-documentation.html#Running-Other-Programs-as-Subprocesses, you need to capture the output. This is one of the documented ways:

(with-output-to-string (s)
      (ccl:run-program "ls" nil :output s))

The output is now contained in s and you can do whatever you want with it.

OTHER TIPS

Try running it as:
(run-program "tail" '("ssqHitNum.txt") :output *standard-output*) The second argument to run-program must contain the parameters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top