File:  [NeXTSTEP 3.3 examples] / Examples / UNIX / Subprocess / README.rtf
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:48:25 2018 UTC (8 years, 1 month ago) by root
Branches: NeXT, MAIN
CVS tags: NeXTSTEP33, HEAD
Sample Programs from NeXSTEP 3.3

{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\fmodern Courier;\f2\fmodern Ohlfs;}
\paperw11320
\paperh10440
\margl380
\margr120
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ulnone\fs24\fc0\cf0 \

\b About the Subprocess object and the example application\

\b0 \
This file describes the Subprocess object and contains an illustrative/example application.  It first provides an overview of the Subprocess object, then describes the classes in the example application, and finally lists the files included in the directory with a description of each.\
\

\b \
The Subprocess object\

\b0 \
The Subprocess object facilitates the management of concurrent, asynchronous UNIX processes within a NeXTstep application.  Methods are provided for the creation, termination and communication with the underlying UNIX process.  The UNIX subprocess communicates with its parent NeXTstep application through delegation.  Three delegate methods provide notification of pending output, termination and errors from the UNIX subprocess.  It is the responsibility of the Subprocess instantiator to implement the three delegate methods and decide what to do with the resulting data.  In addition to providing a controlled NeXTstep interface to standard UNIX utilities (i.e., 
\f1 ls
\f0 , 
\f1 find
\f0 , 
\f1 man
\f0 , 
\f1 rdist
\f0 ), the Subprocess object can also provide, on request, the environment necessary for UNIX processes that require pseudo terminal (or 
\i pty
\i0 ) support.  Some UNIX applications that require pty support include 
\f1 ftp
\f0 , 
\f1 gdb
\f0 , 
\f1 sh
\f0 , 
\f1 csh
\f0 , 
\f1 kermit
\f0 , and 
\f1 tip
\f0 .  The Subprocess object permits a NeXTstep application developer to utilize the power of underlying UNIX utilities without having to program the low-level UNIX systems calls that would otherwise be necessary.  See the specification sheet (Subprocess.rtf) for more information.\
\
\

\b Major classes in the example application\

\b0 \
The example application is called �MyShell.�  It is a minimal implementation of a Shell-like program which uses a UNIX Bourne shell subprocess.  The main user interface of MyShell is a ScrollView.  The user and system share the scrollView for input and output.  The user's input is displayed in bold font.  The system's output is displayed in normal font.  The only special key handled (besides the normal printable ASCII keys) is the 
\f1 Delete
\f0  key.  It is the responsibility of the application writer to pass on other shell-useful control key sequences (e.g., escape, interrupt, etc.).  Below is a description of the major classes in the MyShell example.\
\
Subprocess		Described above and in the specification sheet (Subprocess.rtf).\
\

\fi-2880\li2880 CommandScroll		This class manages the MyShell ScrollView by setting the fonts as appropriate for user input and system output, tracking user input and handling the 
\f1 Delete
\f0  key.  CommandScroll is a minimal subclass of ScrollView in order to implement a simple shell application.\

\fi0\li0 \

\fi-2880\li2880 Coordinator		This class manages the example application by starting the accompanying �/bin/sh� subprocess and acts as the liaison between the subprocess object instance and the user's ScrollView.  When the user quits the application, this subclass terminates the subprocess before the application terminates (using the Application delegate �appWillTerminate:�).\

\fi0\li0 \
\

\b Other files\

\b0 \

\fi-2880\li2880 Subprocess.rtf		The specification sheet for the Subprocess object.\

\fi0\li0 \

\fi-2880\li2880 MyShell.nib		The user-interface of the sample application, which, in addition to the requisite main menu, consists of a main window with an instance of a CommandScroll customview (a ScrollView subclass).\

\fi0\li0 \

\fi-2880\li2880 InfoPanel.nib		A separate nib file, loaded as needed, containing MyShell's Info Panel.\

\fi0\li0 \

\fi-2880\li2880 MyShell.tiff		The TIFF file containing the application icon for MyShell.\

\fi0\li0 \
MyShell_main.m,	Created by Project Builder.\
PB.project,\
Makefile,\
MyShell.iconheader\
\

}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.