[ENH][GOODIE] OSProcess V2.7 (version 2.7 released)

David T. Lewis lewis at mail.msen.com
Sun Jan 6 15:30:10 UTC 2002


OSProcess 2.7
Previous released version: OSProcess 2.6.1
Corresponding CommandShell version: 1.6

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')

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

The classes in OSProcess are:

Object
	OSProcess
		ExternalOSProcess 
			ExternalMacOSProcess
			ExternalOS2Process 
			ExternalRiscOSProcess
			ExternalUnixProcess
				ConnectedUnixProcess 
			ExternalWindowsOSProcess
		ThisOSProcess
			MacProcess
			OS2Process
			RiscOSProcess
			UnixProcess 
			WindowsProcess
	Stream
		OSPipe
		InternalPipe
	OSProcessAccessor
		MacOSProcessAccessor
		OS2OSProcessAccessor
		RiscOSProcessAccessor
		UnixOSProcessAccessor
		WindowsOSProcessAccessor
	InterpreterPlugin
		UnixOSProcessPlugin
			UnixOSProcessPluginDynamicThisSession
			UnixOSProcessPluginInterpreterGetThisSession
			UnixOSProcessPluginStaticThisSession

Known bugs in 2.7:
- 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 connectToXDisplay method is probably dangerous from a security
  perspective.
- UnixOSProcessAccessor>>primitiveEnsetEnv uses the function unsetenv(),
  which is not available on Solaris (and possibly other systems). I do not
  know the portable equivalent of unsetenv(), so for now Solaris users
  will need to comment out the call to unsetenv() and rebuild the plugin.
  Other than failing the SUnit tests, commenting the function out has
  little practical impact.

Changes in 2.7 since 2.6:
- Various changes to support CommandShell version 1.6.
- Added a version string to both OSProcess and UnixOSProcessPlugin to keep
  track of the OSProcess release version and check that the unix plugin is
  up to date with respect to the image. See OSProcess>>versionInformation.
- Add better identification string to the plugin C code for all subclasses
  of UnixOSProcessPlugin, with a primitive to query the plugin for its
  version information (UnixOSProcessPlugin>>primitiveVersionString).
- Add OSProcess class>>removeAllOSProcessAndCommandShellClassesFromSystem,
  which does exactly that.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OSProcessV2-7-dtl.cs.gz
Type: application/x-gunzip
Size: 60828 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020106/8a1c73b5/OSProcessV2-7-dtl.cs.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OSProcess-sUnitV2-7-dtl.cs.gz
Type: application/x-gunzip
Size: 5006 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20020106/8a1c73b5/OSProcess-sUnitV2-7-dtl.cs.bin


More information about the Squeak-dev mailing list