[ENH][GOODIE] OSProcess V2.1 (version 2.1 released)

David T. Lewis lewis at mail.msen.com
Mon May 7 13:23:00 UTC 2001


Reposted due to apparent problems with the mailing list.
-------------------------------------------------------
OSProcess 2.1
Previous released version: 2.0

Changes in 2.1 since 2.0:
- Fixed up a lot of stuff to provide support for CommandWindow.
- Removed class Shell, and refactored into ConnectedUnixProcess, UnixCommand,
  and CommandWindow (CommandWindow in not part of this change set).
- Improved UnixProcess>>makeVM.
- Added sandbox security checks to UnixOSProcessPlugin.
- Reorganized class categories to encourage ports to non-Unix environments
  (any volunteers?)
- Added UnixProcess>>recapitate to restore the X display for a previously
  decapitated Squeak session. Somebody asked about this, so I did it.
- Added a primitiveRename, a workaround for limitations in the normal
  implementation. This should be removed later on, but tpr might want
  to use it for the time being for VMMaker.

OSProcess provides access to the external operating system from Squeak.
A plugin is provided for Unix (and Linux) systems. Placeholder classes
are provided in the OSProcess hierarchy for other operating systems
(Windows, Mac, OS/2), 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:
       UnixProcess command: 'xeyes'
 - Simulate a simple Unix shell:
       (UnixCommand 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).
 - 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')

See the separate CommandWindow change set for a Unix shell window
which uses OSProcess.

The classes in OSProcess are:

		OSProcess
			ExternalOSProcess 
				ExternalMacOSProcess
				ExternalOS2Process 
				ExternalRiscOSProcess
				ExternalUnixProcess
					ConnectedUnixProcess 
						UnixCommand
				ExternalWindowsOSProcess
			ThisOSProcess
				MacProcess
				OS2Process
				RiscOSProcess
				UnixProcess 
				WindowsProcess
		ShellWindow
		OSPipe
		Model
			OSProcessAccessor
				MacOSProcessAccessor
				OS2OSProcessAccessor
				RiscOSProcessAccessor
				UnixOSProcessAccessor
				WindowsOSProcessAccessor
		InterpreterPlugin
			UnixOSProcessPlugin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OSProcessV2-1.cs.gz
Type: application/x-gunzip
Size: 54476 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010507/ea5975b0/OSProcessV2-1.cs.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UnixOSProcessPlugin.c.gz
Type: application/x-gunzip
Size: 12210 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20010507/ea5975b0/UnixOSProcessPlugin.c.bin


More information about the Squeak-dev mailing list