[plt-scheme] Help running operating systems commands.

From: David Hugh-AHD003 (hugh.david at motorola.com)
Date: Mon Sep 26 09:35:38 EDT 2005

to:   plt-scheme at list.cs.brown.edu
from: hugh.david at motorola.com

Hello,

Is there a way to run external programs or any general operating system command from within DrScheme (or another of the languages)?

For example, given a windows batch file called "hello.bat" containing the line

echo "hello"

Is there a way to run this batch file and capture its output and exit status?

In Python, I would type the commands

>>> import os
>>> os.system("hello.bat")

and get the output such as

"hello world"
0

Is something similar possible from within DrScheme (or another of the languages)?

For example,

> (display (run-os-command "hello.exe))
(("hello") 0)

Thank you very much in advance for your help.

My regards,

Hugh

P.S. PLT Scheme is great. Thank you for such a wonderful programming environment!


Posted on the users mailing list.