Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
OSProcess
Last updated at 9:03 pm UTC on 24 November 2008

OSProcess Version 4.3.7 (November 24, 2008)

Contributed by Dave Lewis

Download OSProcess from OSProcessV4-3-7.sar

Version 4 supports Squeak 3.6 through 3.10 (and probably earlier versions as well), including 64 bit Squeak.

The plugin for OSProcess is separate from the OSProcess package, and is distributed as OSProcessPlugin, XDisplayControlPlugin and AioPlugin.

To easily communicate with external OS processes, use class PipeableOSProcess, which is included in the separate CommandShell package.

Description:

OSProcess provides access to operating system functions, including pipes and child process creation. It is implemented using pluggable primitives in a shared library for Unix or Linux, and a DLL for Windows. The Smalltalk code, including the classes which implement pluggable primitives for Unix or Win32 operating system functions, may be loaded into any Squeak image, but the primitives are only useful on Unix and Windows systems. Placeholder classes are provided for MacOS, OS/2 and RiscOS, but are not yet implemented.

Version 4 supports 64-bit and 32-bit Squeak.
As of version 3, OSProcess provides limited support for Windows in addition to Unix/Linux.

See also: CommandShell which uses OSProcess to implement a Unix command shell and terminal window in Squeak. The Windows support is not as complete as that for Unix, but it is sufficient for running external Win32 programs from Squeak.

If you use OSProcess, you may also be interested in CommandShell, DirectoryPlugin, and IOHandle.

If you have an iPAQ handheld, check out http://www.reasonability.net/ipaq/.

Changes in 4.3.7 since 4.3.6:



Known bugs:

Previous versions of OSProcess:


Version 4.3.6 (December 23, 2007) OSProcessV4-3-6.sar




Version 4.3.5 (December 22, 2007) OSProcessV4-3-5.sar




Version 4.3.4 (December 20, 2007) OSProcessV4-3-4.sar




Version 4.3.3 (April 8, 2007) OSProcessV4-3-3.sar




Version 4.3.2 (April 1, 2007) OSProcessV4-3-2.sar




Version 4.3 (January 2007) OSProcessV4-3.sar




Version 4.0.1 (November 2005) OSProcessV4-0-1.sar


Version 4.0 (October 2005) OSProcessV4-0.sar


Version 3.2.5 (May 2005) OSProcessV3-2-5.sar


Version 3.2.4 (March 2005)OSProcessV3-2-4.sar


Version 3.2.3 (March 2005)OSProcessV3-2-3.sar.


Version 3.2.2 (February 2004)OSProcessV3-2-2.sar.
Changes in 3.2.2 since 3.2.1:

Here is a copy of OSProcess 3.2.2 that loads with most of the interactive dialogs disabled. This is for inclusion into Lex's first Universes test. It is identical to the OSProcessV3-2-2.sar (see above) that is used for SqueakMap except for the modified load scripts.OSProcessV3-2-2-noChat.sar____


Version 3.2.1 (January 2004)OSProcessV3-2-1.sar(contains Unix file locking)
Version 3.2.1 supports Squeak 3.6.

The OSProcessPlugin (OSPP) is now distributed as a separate SqueakMap package, as is the new XDisplayControlPlugin package. The previous released version of OSP was 3.1 (version number 3.2 referred to an unleased version of OSP that was used for OS/X compatibility testing).


Version 3.1 (August 2003)
Version 3.1:OSProcess-V3-1.sar.


Version 3.0.6 (July 2003)
Version 3.06:OSProcessV3-0-6.sar.


Version 2.7 (January 6, 2002)


Version 2.6 (December 8, 2001)


Version 2.5 (November 22, 2001)


Version 2.4 (October 20, 2001)




Version 2.3 (July 2, 2001)


Version 2.2 (May 27, 2001)
Note: Some browsers may drop the ".gz" file name suffix when you download. If this happens, just rename the file back to OSProcessV2-2.cs.gz on your local system.


OSProcess for Unix Squeak - Version 2.1 (May 5, 2001)

OSProcess for Unix Squeak - Version 2.0 (March 11, 2001)

Download these files:

Changes in 2.0 since 1.5:



Download version 1.5 fromhttp://swiki.gsug.org:8080/sqfixes/1242.htmlChanges in 1.5 since 1.4:

Help wanted: Concrete class implementations for Windows, Mac, etc. This should be easier now that FFI callouts are available. Anyone care to help?


Download version 1.4 fromhttp://swiki.gsug.org:8080/sqfixes/1123.html

Changes in 1.4 since 1.3:


Download version 1.3 fromhttp://swiki.gsug.org:8080/sqfixes/1032.htmlThis version is updated for Squeak 2.8 and 2.9a. If you are building your Unix VM from the SourceForge repository, you should update your OSProcess to this new version.

The Unix plugin module name has been changed to UnixOSProcessPlugin.c. This is for consistency with other pluggable modules for the new pluggable VM.

The Smalltalk code is not backwardly compatible, because the primitive calling methods have been changed to use the new module name.


OSProcess for Unix Squeak - Version 1.2

Note to SourceForge VM folks: If you are using the pluginized VM, you will need to move the declaration of thisSession from sqFilePrims.c to sqXWindow.c. However, since sqFilePrims.c is one of the common modules exported from the image, I don't want to hack it on SF. Therefore, until I think of a better approach, you can fix your local sources as follows:

In sqFilePrims.c, change the declaration to:
extern int thisSession;
And in sqXWindow.c, add a declaration:
int thisSession = 0;

Download version 1.2 fromhttp://swiki.gsug.org:8080/sqfixes/982.html.

OSProcess for Unix Squeak - Version 1.1Updatedfor Squeak 2.7.

Files are contained in theosprocessv1-1-2.zipzip archive.
OSProcessV1-1-2.zip fixes an error in sqXWindow.c from the OSPRocessV1-1.zip version, and adds support for a "-headless" command line option for Unix. There are no other changes since OSProcessV1-1. dtl 2-April-2000.


OSProcess for Unix Squeak - Version 0.4
Release notes for version 0.4:Readme-OSProcessV0.4
Files:
  • Missing File (/squeak/uploads/osprocessv0.4.src.tgz) C source files
  • osprocess.4octo1251pm.cs Smalltalk source
  • osprocessv0-4-linux-2-2-10.tgz Linux binaries (lib6)

  • osprocessv0-4-linux-2-0-35.tgz Linux binaries (older system)
  • osprocessv0-4-freebsd-2-2-6.tgzFreeBSD binaries


    OSProcess for Unix Squeak - Version 0.3 (original release)
    Files:
    liReadme-OSProcessV0-3 Readme file for OSProcess
  • OSProcess.5July250pm.cs The change set - file this in to your image
  • Missing File (/squeak/uploads/OSProcessV0.3.tar.gz) Supporting files in gzipped tar format
  • Missing File (/squeak/uploads/OSProcessV0.3.zip) Same supporting files, but in zip format
  • Missing File (/squeak/uploads/sqXWindow.c.diff-OSProcessV0.3) For convenience, a diff of the sqXWindow.c changes


    Current capabilities include:
  • Inspect the OS process in which Squeak is running: "OSProcess forThisOSProcess inspect"
    liRead standard input, and write standard output and standard error streams.
    liCreate operating system pipes and attach them to AttachableFileStream streams.
    liCreate Unix child processes with protocol similar to (same as?) VisualWorks.
    liClean up child processes automatically on exit (a Semaphore is set after receiving a SIGCHLD signal), with child exit status available in Squeak.
    liStart a second Squeak in a child process, restarting the child from the last saved image file: "UnixProcess squeak"
    liClone the running Squeak image, producing two nearly identical Squeaks running from the same object memory at the time of cloning: "UnixProcess forkSqueak"
    liClone the running Squeak image, but with no display connection for the child: "UnixProcess forkHeadlessSqueakAndDo: aBlock"
    liClone the running Squeak image with no display connection, execute a block, and exit (similar to running a command from a Unix shell, except that the "command" is a Smalltalk block): "UnixProcess forkHeadlessSqueakAndDoThenQuit: aBlock"


    Notes:

    If you are using a non-Unix platform, you can just file in the Smalltalk files and have a look around. All of the code except for some minor patches to the existing Unix support files is written in Smalltalk. On Unix systems, some patches to sqXWindow.c (the C main program) are required in order to permit access to the command line, environment, stdio, stdout, and stderr. A patch file for this and for the makefile changes is included here.
    There are also changes to the interpreter support files to provide access to SQFile data structures from pluggable primitives. The changes do not effect the rest of the Squeak system, but they do require a one time rebuild of the virtual machine and all the dynamically loaded modules. The OSProcess primitives are implemented as pluggable primitives in a loadable module. There are no changes to the base VM other than those described above.


    Installation:

    These notes are from the 0.3 release. Release 0.4 provides binaries for some systems, but building from source is left as an exercise
    for the reader (at least until the next update of the Unix VM source code is available).

    To add OS Process support to Squeak on Linux (and probably other Unix systems), follow these steps for the quick installation, or (for the more patient and inquisitive) the bootstrap installation.Quick InstallBootstrap Install