Hi All,

The function node below takes the path of a JavaScript file, starts
"node" (JavaScript evaluator) using "system". The output is
collected in a string.

    (define (node path)
      (with-output-to-string
          (λ ()
            (system (string-append "/usr/local/bin/node " " " (path->string
path))))))

The function is used from within DrRacket. If the JavaScript program doesn't
terminate, I use cmd-b to break the process. Control is given back to the
repl, but the node system process keeps running in the background - and
needs to be killed manually.

How can I kill the node system process from within DrRacket?

One of my attempts that didn't work:

    (define (node path)
      (with-output-to-string
          (λ ()
            (parameterize ([current-subprocess-custodian-mode 'kill]
                           [subprocess-group-enabled          #t])
              (system (string-append "/usr/local/bin/node " " "
(path->string path)))))))

-- 
Jens Axel Søgaard

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to