Discussion:
[squeak-dev] A small convenience update to OSProcess/CommandShell
David T. Lewis
2014-10-07 04:36:47 UTC
Permalink
I have updated OSProcess/CommandShell with some changes that allow
PipeableOSProcess to be used more conveniently for executing commands on
a Unix/Linux/OSX system. You can now run a simple command without worrying
about closing (pipe) file handles or other special handling. For example:

( PipeableOSProcess command: 'ls -l' ) output

Explanation: PipeableOSProcess was originally designed to support command
pipeline execution within a CommandShell. In that scenario, the command shell
handles all setup and cleanup of pipe handles. In practice, PipeableOSProcess
turns out to be useful for simple command execution with input and output
pipes connected to the image. The updates to PipeableOSProcess class>>command:
add the necessary setup and cleanup that would otherwise have been done by
the command shell.

OSProcess and CommandShell are on SqueakMap (select the "head" version to
get the latest), or from the squeaksource repository at:

http://www.squeaksource.com/OSProcess
http://www.squeaksource.com/CommandShell

Dave
Chris Muller
2014-10-07 21:03:11 UTC
Permalink
A good improvement!
Post by David T. Lewis
I have updated OSProcess/CommandShell with some changes that allow
PipeableOSProcess to be used more conveniently for executing commands on
a Unix/Linux/OSX system. You can now run a simple command without worrying
( PipeableOSProcess command: 'ls -l' ) output
Explanation: PipeableOSProcess was originally designed to support command
pipeline execution within a CommandShell. In that scenario, the command shell
handles all setup and cleanup of pipe handles. In practice, PipeableOSProcess
turns out to be useful for simple command execution with input and output
add the necessary setup and cleanup that would otherwise have been done by
the command shell.
OSProcess and CommandShell are on SqueakMap (select the "head" version to
http://www.squeaksource.com/OSProcess
http://www.squeaksource.com/CommandShell
Dave
Craig Latta
2014-10-09 13:07:52 UTC
Permalink
You can now run a simple command without worrying about closing
( PipeableOSProcess command: 'ls -l' ) output
Thanks!


-C

--
Craig Latta
netjam.org
+31 6 2757 7177 (SMS ok)
+ 1 415 287 3547 (no SMS)

Loading...