[ENH][GOODIE] OSProcess V2.4 (version 2.4 released)

David T. Lewis lewis at mail.msen.com
Sun Oct 21 14:22:35 UTC 2001


OSProcess 2.4
Previous released version: 2.3
Corresponding CommandShell version: 1.3

OSProcessV2-4.cs is the main change set for OSProcess.
OSProcess-sUnit-V2-4.cs contains SUnit tests (not required).
See the separate CommandShell change set for a Unix shell window
which uses OSProcess.

OSProcess provides access to the external operating system from Squeak.
A plugin is provided for Unix (and Linux) systems. OSProcess can be
loaded on any platform, and placeholder classes are provided in the
OSProcess hierarchy for other operating systems (Windows, Mac, OS/2,
RiscOS), but support for these systems is not yet implemented.

You can:
 - Open a inspector on the operating system process in which
   Squeak is running (OSProcess thisOSProcess).
 - Read or write on the stdin, stdout, and stderr streams.
 - Access the command line, and get or set environment variables.
 - Fork and exec external programs, with control of the command
   line, environment, and stdin/stdout/stderr.
 - Open an inspector on a child operating system process created
   from Squeak, with run state and exit status of the child updated
   asynchronously.
 - Run an external command:
       OSProcess command: 'xeyes'
 - Connect directly to input and outputs of external commands:
       (ConnectedUnixProcess command: 'ls -l *') output
 - Create pipes and connect them to external processes.
 - Execute external command pipelines from Squeak:
       ((ConnectedUnixProcess command: 'ps') | 'grep squeak' | 'cut -c16-100') output
 - Fork an exact clone of the current running Squeak image (no
   image file) with parent and child Squeak processes proceeding
   from the same point in memory (UnixProcess forkSqueak).
 - Fork a Squeak using the disk based image (UnixProcess squeak).
 - Start a headless Squeak from the running Squeak image, giving
   it an expression to evaluate:
       (UnixProcess forkHeadlessSqueakAndDoThenQuit:
           [UnixProcess command: 'echo hello world'])
 - Tell the running image to go headless (UnixProcess decapitate), and
   reconnected the image with a window (UnixProcess recapitate).
-  Move the display to another computer on the network:
       (UnixProcess displayOnXServer: 'someOtherComputer')
 - Restart the VM on the fly (UnixProcess restartVirtualMachine).
 - Rebuild the VM, and restart Squeak with the new VM if the
   build was successful (UnixProcess makeVM).
 - Start your Swiki in a headless background process:
       (UnixProcess startSwiki: 'myswiki' onPort: 8081 loggingTo: 'log.txt')

Known bugs in 2.4:
- Forking a child Squeak, as in UnixProcess>>forkSqueak, results in two
  instances of Squeak which share a single changes file. This has no
  practical impact if one or the other of the Squeak processes exits without
  doing very much, but it would probably result in a corrupted changes
  file if both Squeak instances do a lot of changes. I am leaving this as
  is for now, since a quick fix would require one of the Squeaks to
  save itself under an different image name.
- The new connectToXDisplay method is probably dangerous from a security
  perspective.

Changes in 2.4 since 2.3:
- Added UnixProcess class>>connectToXDisplay: to permit a running Squeak to
  reconnect its display to another X server, possibly on another computer
  (implemented per suggestion from Stephen Pair). This change requires
  adding <sys/Xlib.h> to the includes for the UnixOSProcessPlugin. I do not
  really like adding the X dependencies into the plugin, but the alternative
  would be more changes to sqXWindow.c, which is hard to get implemented
  and distributed. This also may be a security concern in some situations.
- Miscellaneous changes and fixes to support CommandShell.
- Moved all shell syntax processing into the CommandShell change set, and
  eliminated class UnixCommand entirely
- Various fixes for bugs found in SUnit testing.
- Renamed class categories to look nicer in a package browser.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OSProcessV2-4.cs.gz
Type: application/x-gunzip
Size: 58441 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20011021/c746c4e2/OSProcessV2-4.cs.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OSProcess-sUnit-V2-4.cs.gz
Type: application/x-gunzip
Size: 4394 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20011021/c746c4e2/OSProcess-sUnit-V2-4.cs.bin


More information about the Squeak-dev mailing list