I'm running Squeak3.7-MacOS-Full on my OS X 10.3 box. Everyhing works fine when I click on the appropriate icons. But I can't figure out out to run it from a command line. The "executable" is an ".app"--which acts like a directory when I am at a command line. So I can't find anyhting to execute. Do I need a different vm?
Thanks, david
-- David Farber dfarber@numenor.com
Using the "open" command should do the trick (i.e., "$ open Firefox.app"). It's the same as double-clicking on the application's icon.
- Joe
On Nov 2, 2004, at 6:17 PM, David Farber wrote:
I'm running Squeak3.7-MacOS-Full on my OS X 10.3 box. Everyhing works fine when I click on the appropriate icons. But I can't figure out out to run it from a command line. The "executable" is an ".app"--which acts like a directory when I am at a command line. So I can't find anyhting to execute. Do I need a different vm?
Thanks, david
-- David Farber dfarber@numenor.com
Thanks Joe (and Simon and Frank).
Next question: How does the notion of an "app" in OS X map to the traditional idea of a process in unix. Specifically, does an app still have stdin/stdout/stderr? When I use 'open' on the command line, it appears to always fork the program call--is that baked in?
I'd like to get my hands on stdin/stdout/stderr of the main squeak process. I've got Ian's OS X binaries and OSProcess seems to work (at least, the CommandShell works) although not all of tests pass. But 'OSProcess helloWorld' doesn't print anything to the console that started squeak.
Pointers? Ideas?
Thanks, david
At 06:43 PM 11/2/2004 -0500, you wrote:
Using the "open" command should do the trick (i.e., "$ open Firefox.app"). It's the same as double-clicking on the application's icon.
- Joe
On Nov 2, 2004, at 6:17 PM, David Farber wrote:
I'm running Squeak3.7-MacOS-Full on my OS X 10.3 box. Everyhing works fine when I click on the appropriate icons. But I can't figure out out to run it from a command line. The "executable" is an ".app"--which acts like a directory when I am at a command line. So I can't find anyhting to execute. Do I need a different vm?
Thanks, david
-- David Farber dfarber@numenor.com
-- David Farber dfarber@numenor.com
On Tuesday 02 November 2004 9:14 pm, David Farber wrote:
Next question: How does the notion of an "app" in OS X map to the traditional idea of a process in unix. Specifically, does an app still have stdin/stdout/stderr? When I use 'open' on the command line, it appears to always fork the program call--is that baked in?
I'd like to get my hands on stdin/stdout/stderr of the main squeak process. I've got Ian's OS X binaries and OSProcess seems to work (at least, the CommandShell works) although not all of tests pass. But 'OSProcess helloWorld' doesn't print anything to the console that started squeak.
Pointers? Ideas?
Another possibility is to use the Unix VM for the Mac, and just start it from a shell script.
On 02 Nov 2004, at 22:40, Ned Konz wrote:
I'd like to get my hands on stdin/stdout/stderr of the main squeak process. I've got Ian's OS X binaries and OSProcess seems to work (at least, the CommandShell works) although not all of tests pass. But 'OSProcess helloWorld' doesn't print anything to the console that started squeak.
Pointers? Ideas?
Another possibility is to use the Unix VM for the Mac, and just start it from a shell script.
This is by far the easiest way to run the VM and have stdin/out/err point at something useful (the controlling terminal). You have to run the binary (.../Contents/MacOS/squeak) directly, rather than "open"ing the application. (When you run "open" on an app, stdio is redirected to less useful places -- as if you'd double-clicked on the app's icon from within the Finder.)
It's ages since I looked inside OSProcess, but if it lets you send/receive Strings to/from stdio and you run the binary in the above manner then you should be able to interact with the controlling terminal trivially.
(FWIW, if you "open" an app or double-click the icon then stderr is redirected to the "console log", the contents of which you can see by running the "console" app in the /Applications/Utilities folder. I don't know [but doubt] if stdout reaches the same place, and I suspect stdin is simply closed before the app even gets control.)
Ian
Ian - Thanks. I am able to access stdin&co when I run the binary directly.
Next question: When I try to use the -vm-null-display flag I get an infinite loop on the console saying:
dyld: undefined symbol: _dypPitch
This happens with your 3.6-3 and 3.7b-5 vms. Am I missing some library?
david
At 01:48 PM 11/3/2004 -0800, you wrote:
On 02 Nov 2004, at 22:40, Ned Konz wrote:
I'd like to get my hands on stdin/stdout/stderr of the main squeak process. I've got Ian's OS X binaries and OSProcess seems to work (at least, the CommandShell works) although not all of tests pass. But 'OSProcess helloWorld' doesn't print anything to the console that started squeak.
Pointers? Ideas?
Another possibility is to use the Unix VM for the Mac, and just start it from a shell script.
This is by far the easiest way to run the VM and have stdin/out/err point at something useful (the controlling terminal). You have to run the binary (.../Contents/MacOS/squeak) directly, rather than "open"ing the application. (When you run "open" on an app, stdio is redirected to less useful places -- as if you'd double-clicked on the app's icon from within the Finder.)
It's ages since I looked inside OSProcess, but if it lets you send/receive Strings to/from stdio and you run the binary in the above manner then you should be able to interact with the controlling terminal trivially.
(FWIW, if you "open" an app or double-click the icon then stderr is redirected to the "console log", the contents of which you can see by running the "console" app in the /Applications/Utilities folder. I don't know [but doubt] if stdout reaches the same place, and I suspect stdin is simply closed before the app even gets control.)
Ian
-- David Farber dfarber@numenor.com
On Wed, Nov 03, 2004 at 01:48:07PM -0800, Ian Piumarta wrote:
It's ages since I looked inside OSProcess, but if it lets you send/receive Strings to/from stdio and you run the binary in the above manner then you should be able to interact with the controlling terminal trivially.
OSProcess gives you a StandardFileStream attached to the stdio streams. Actually it's an AttachableFileStream, which is just a StandardFileStream grafted onto an existing stdin/stdout/stderr handle.
Also, even though I don't have an OS X system to try it on, it's just another Unix system underneath so you can probably do things like:
FileStream oldFileNamed: '/dev/tty'
Which gives you a StandardFileStream on the stdin/stdout streams. Be careful about closing these streams by the way, as they tend to stay closed, and they refer to the same IO streams that OSProcess is using.
Dave
Well if you root all the way down to the binary lurking in the bottom of the *.app directory
./Users/johnmci/Documents/Squeak3.8.0/build/Squeak\ 3.8.2Beta2.app/Contents/MacOS/Squeak\ VM\ Opt
You'll find a Unix binary ls -l total 6328 -rwxr-xr-x 1 johnmci staff 3237148 6 Oct 20:32 Squeak VM Opt
That has stdin/stdout/stderr The mac carbon VM even declares main as int main(int argc, char **argv, char **envp) so you techically can pass in those unixiy things, getting at them is an issue, mind the OSProcess I did a bit for Carbon could dynamically link and load and get at those globals.
On Nov 2, 2004, at 9:14 PM, David Farber wrote:
Thanks Joe (and Simon and Frank).
Next question: How does the notion of an "app" in OS X map to the traditional idea of a process in unix. Specifically, does an app still have stdin/stdout/stderr? When I use 'open' on the command line, it appears to always fork the program call--is that baked in?
I'd like to get my hands on stdin/stdout/stderr of the main squeak process. I've got Ian's OS X binaries and OSProcess seems to work (at least, the CommandShell works) although not all of tests pass. But 'OSProcess helloWorld' doesn't print anything to the console that started squeak.
Pointers? Ideas?
Thanks, david
At 06:43 PM 11/2/2004 -0500, you wrote:
Using the "open" command should do the trick (i.e., "$ open Firefox.app"). It's the same as double-clicking on the application's icon.
- Joe
On Nov 2, 2004, at 6:17 PM, David Farber wrote:
I'm running Squeak3.7-MacOS-Full on my OS X 10.3 box. Everyhing works fine when I click on the appropriate icons. But I can't figure out out to run it from a command line. The "executable" is an ".app"--which acts like a directory when I am at a command line. So I can't find anyhting to execute. Do I need a different vm?
Thanks, david
-- David Farber dfarber@numenor.com
-- David Farber dfarber@numenor.com
-- ======================================================================== === John M. McIntosh johnmci@smalltalkconsulting.com 1-800-477-2659 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ======================================================================== ===
squeak-dev@lists.squeakfoundation.org