[ENH][GOODIE] OSProcess V1.4
David T. Lewis
lewis at mail.msen.com
Tue Oct 10 10:26:44 UTC 2000
OSProcess is contributed under the terms of Squeak-L. Please copy freely.
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.
Changes in 1.4 since 1.3:
- Split UnixOSProcessAccessor into two classes. UnixOSProcessPlugin now
contains the methods which can be translated to a C plugin library,
and UnixOSProcessAccessor no longer contains the plugin code. Cleaned
up some of the plugin code to minimize C compiler warnings for strict
compilers.
- Added various improvements to child process handling, particularly across
image restarts. Added a primitive to UnixOSProcessPlugin to allow Squeak
to check if a child process still exists following an image restart.
ExternalOSProcess proxies now do a better job of keeping track of the
external OS processes which they represent.
- Added UnixProcess class>>makeVM utility for rebuilding the VM from a
running Squeak session.
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')
- Create pipes and connect them to external processes.
- 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).
- 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')
The classes in OSProcess are:
OSProcess
ExternalOSProcess
ExternalUnixProcess
ConnectedUnixProcess
ThisOSProcess
MacProcess
OS2Process
UnixProcess
WindowsProcess
OSProcessAccessor
MacOSProcessAccessor
OS2OSProcessAccessor
UnixOSProcessAccessor
WindowsOSProcessAccessor
AttachableFileStream
OSPipe
ShellProxy
ShellWindow
UnixOSProcessPlugin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OSProcessV1-4.cs.gz
Type: application/x-gunzip
Size: 32291 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20001010/151760d9/OSProcessV1-4.cs.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UnixOSProcessPlugin.c.gz
Type: application/x-gunzip
Size: 4561 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20001010/151760d9/UnixOSProcessPlugin.c.bin
More information about the Squeak-dev
mailing list
|