Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!tektronix!tekcrl!tekchips!jans From: jans@tekchips.TEK.COM (Jan Steinman) Newsgroups: comp.lang.smalltalk Subject: Re: Communication with the outside world Message-ID: <1709@tekchips.TEK.COM> Date: Sat, 19-Sep-87 21:49:13 EDT Article-I.D.: tekchips.1709 Posted: Sat Sep 19 21:49:13 1987 Date-Received: Sun, 20-Sep-87 20:45:43 EDT Organization: Tektronix Inc., Beaverton, Or. Lines: 41 <<>> This is one of the first things I put in an image: Smalltalk at: #Ksh put: (OSFilter openOn: '/bin/ksh' withArguments: #('-i')). Then any application can simply "nextPutAll:" and "nextAvailable" to communicate with Unix processes, using wildcards and I/O redirection and any other shell fancies needed. We provide examples for using an OSFilter with sed and cpp in order to parse an arbitrary ".h" file into a Dictionary of symbol-value Associations. Another way we've tried to make Smalltalk and Unix get along is to allow standard input to file in. This allows Smalltalk to be used inside a Makefile! This aids considerably when dealing with multi-person projects, allowing automatic generation of images, as shown in this Makefile fragment: .st.im: @echo "!SystemDictionary methodsFor: 'time-versions'!\nversionNumber\n" '"Return the version number of this release of Tektronix Smalltalk-80."\n\n\ "^'$(@:.im=)'! !\n(Smalltalk snapshotPrimitive: '$@') isNil\n\tifTrue: [Smalltalk quit].\nSmalltalk postSnapshot.\nSmalltalk startUp!" | cat $< - | smalltalk (Warning! Line breaks have been automagically inserted!) When you type "make X2.3.6.im", make looks for a file named "X2.3.6.st" and files it into Smalltalk using "cat". When that file-in is finished, the method that defines the version number is updated, the updated image "X2.3.6.im" is written out, and smalltalk is exited. In addition, each Unix system call is accessible from within Tektronix Smalltalk. We took care to use naming conventions designed to make the use of such calls easy. In short, if you can do it in C, you can do it in Tek Smalltalk! :::::: Software Productivity Technologies --- Smalltalk Project :::::: :::::: Jan Steinman N7JDB Box 500, MS 50-470 (w)503/627-5881 :::::: :::::: jans@tekcrl.TEK.COM Beaverton, OR 97077 (h)503/657-7703 ::::::