[squeak-dev] A small convenience update to OSProcess/CommandShell

David T. Lewis lewis at mail.msen.com
Mon Oct 6 23:36:44 UTC 2014


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



More information about the Squeak-dev mailing list