I am sure this must be obvious but I can't find it. How do I determine programmatically which OS I am running on.
Thanks
Bob
*** Confidentiality Notice *** Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email.
On 23-Dec-05, at 1:34 PM, Cowdery, Bob [UK] wrote:
I am sure this must be obvious but I can’t find it. How do I determine programmatically which OS I am running on.
Oh, easy. If it keeps crashing then it must be windows. If it rarely crashes but the GUI is horrible it must be *nix If it rarely crashes and the UI is ok but insists on a single button mouse it must OSX If it rarely crashes - but when it does it really pisses you off - and the GUI is ok with a three button mouse but the machine seems a bit slow by modern standards then it must be RISC OS.
Or you can be really boring and use SmalltalkImage current platformName and look at other methods in SmalltalkImage for further messages to get more or less detail.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim My Go this amn keyboar oesn't have any 's.
On Fri, Dec 23, 2005 at 01:40:09PM -0800, tim Rowledge wrote:
On 23-Dec-05, at 1:34 PM, Cowdery, Bob [UK] wrote:
I am sure this must be obvious but I cant find it. How do I determine programmatically which OS I am running on.
Oh, easy. If it keeps crashing then it must be windows. If it rarely crashes but the GUI is horrible it must be *nix If it rarely crashes and the UI is ok but insists on a single button mouse it must OSX If it rarely crashes - but when it does it really pisses you off - and the GUI is ok with a three button mouse but the machine seems a bit slow by modern standards then it must be RISC OS.
Tim's heuristics are of course correct, but unfortunately nobody has gotten around to implementing the requisite methods for #hasHorribleUserInterface, #hasRecentlyCrashedForNoGoodReason, and #hasRestictiveMousePolicy. These will require some new primitives and platform support code in VMMaker, which of course would be trivial to implement, but I guess somehow this just has not bubbled up to the top of the priority list. Tim, I think you should get the development under way, and schedule it for release next April 1. Come to think of it, an annual april fools' day release of VMMaker with lots of fun new features would be a good tradition to have.
Or you can be really boring and use SmalltalkImage current platformName and look at other methods in SmalltalkImage for further messages to get more or less detail.
There are some examples of how to use this in OSProcess (from SqueakMap). See class OSProcess, class side methods in "platform identification". The various flavors of Mac can be confusing if you need to sort out the difference between pre and post OSX, or if you need to know whether your user is running a regular Mac VM or a Unix VM on OSX.
Dave
David T. Lewis puso en su mail :
The various flavors of Mac can be confusing if you need to sort out the difference between pre and post OSX, or if you need to know whether your user is running a regular Mac VM or a Unix VM on OSX.
That's why another cool not yet implemented device / method is a external tv camera in front of the machine and a image processing program what of a pile of Apple certified machine photos moved with a mechanic arm, guess what model is.
But this could requires John work too !!
Edgar
___________________________________________________________ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar
On 23-Dec-05, at 3:08 PM, Lic. Edgar J. De Cleene wrote:
David T. Lewis puso en su mail :
The various flavors of Mac can be confusing if you need to sort out the difference between pre and post OSX, or if you need to know whether your user is running a regular Mac VM or a Unix VM on OSX.
That's why another cool not yet implemented device / method is a external tv camera in front of the machine and a image processing program what of a pile of Apple certified machine photos moved with a mechanic arm, guess what model is.
Hmm, maybe accessing the unique machine id (there is one on most machines) and having a website with a lookup table would do the trick?
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim BASIC is to computer programming as QWERTY is to typing.
On Fri, Dec 23, 2005 at 08:08:23PM -0300, Lic. Edgar J. De Cleene wrote:
David T. Lewis puso en su mail :
The various flavors of Mac can be confusing if you need to sort out the difference between pre and post OSX, or if you need to know whether your user is running a regular Mac VM or a Unix VM on OSX.
That's why another cool not yet implemented device / method is a external tv camera in front of the machine and a image processing program what of a pile of Apple certified machine photos moved with a mechanic arm, guess what model is.
Great idea! We could also use the mechanical arm for a new primitive #snapshot:andQuit:andTurnOffComputer:
Dave
On 23-Dec-05, at 2:43 PM, David T. Lewis wrote:
Tim, I think you should get the development under way, and schedule it for release next April 1. Come to think of it, an annual april fools' day release of VMMaker with lots of fun new features would be a good tradition to have.
Not a bad idea. Maybe an april1 release that reverses all the pixels?
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Any sufficiently advanced bug is indistinguishable from a feature.
On Fri, Dec 23, 2005 at 03:49:23PM -0800, tim Rowledge wrote:
On 23-Dec-05, at 2:43 PM, David T. Lewis wrote:
Tim, I think you should get the development under way, and schedule it for release next April 1. Come to think of it, an annual april fools' day release of VMMaker with lots of fun new features would be a good tradition to have.
Not a bad idea. Maybe an april1 release that reverses all the pixels?
Good for starters. How hard would it be to turn the display upside down?
Dave
Years ago Broderbund had a karate game that would run upside down if you put the disk in upside down (you could do that on an Atari).
Josh Scholar ----- Original Message ----- From: "David T. Lewis" lewis@mail.msen.com To: "The general-purpose Squeak developers list" squeak-dev@lists.squeakfoundation.org Sent: Friday, December 23, 2005 4:54 PM Subject: Re: Which OS
On Fri, Dec 23, 2005 at 03:49:23PM -0800, tim Rowledge wrote:
On 23-Dec-05, at 2:43 PM, David T. Lewis wrote:
Tim, I think you should get the development under way, and schedule it for release next April 1. Come to think of it, an annual april fools' day release of VMMaker with lots of fun new features would be a good tradition to have.
Not a bad idea. Maybe an april1 release that reverses all the pixels?
Good for starters. How hard would it be to turn the display upside down?
Dave
tim Rowledge wrote:
On 23-Dec-05, at 2:43 PM, David T. Lewis wrote:
Tim, I think you should get the development under way, and schedule it for release next April 1. Come to think of it, an annual april fools' day release of VMMaker with lots of fun new features would be a good tradition to have.
Not a bad idea. Maybe an april1 release that reverses all the pixels?
Way back in my university days, we wrote a little display driver hack for the Atari ST which would turn the screen image by 180 degrees. The fun part was when we ran that on a machine, turned the *monitor* by 180 degrees, too, and asked our boss if he could see what's wrong with the machine...
Cheers and a happy christmas time! Hans-Martin
In 1998, I was working at IBM, in a building with hundreds of programmers. One day I turned my 19 inch monitor on its side, started Squeak, opened a Morphic System Browser, rotated it by 90 degrees, and started to program. I also needed to rotate the mouse by 90 degrees, but got used to it.
People passed by my desk, and kept looking at my display without understanding what was going on. It was fun.
Cheers, Juan ----- Original Message ----- From: "Hans-Martin Mosner" hmm@heeg.de To: "The general-purpose Squeak developers list" squeak-dev@lists.squeakfoundation.org Sent: Saturday, December 24, 2005 6:33 AM Subject: Re: Which OS
tim Rowledge wrote:
On 23-Dec-05, at 2:43 PM, David T. Lewis wrote:
Tim, I think you should get the development under way, and schedule it for release next April 1. Come to think of it, an annual april fools' day release of VMMaker with lots of fun new features would be a good tradition to have.
Not a bad idea. Maybe an april1 release that reverses all the pixels?
Way back in my university days, we wrote a little display driver hack for the Atari ST which would turn the screen image by 180 degrees. The fun part was when we ran that on a machine, turned the *monitor* by 180 degrees, too, and asked our boss if he could see what's wrong with the machine...
Cheers and a happy christmas time! Hans-Martin
-- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.3/209 - Release Date: 12/21/2005
SmalltalkImage current platformName 'Mac OS' 'RiscOS' 'unix' 'Win32' SmalltalkImage current osVersion 1043 SmalltalkImage current platformSubtype powerpc SmalltalkImage current platformSubtype "Squeak3.8 of ''5 May 2005'' [latest update: #6665] Squeak VM 3.8.9b7" which is the version of the image used to build the VM source, and the vm version identity (Squeak VM 3.8.9b7) of the running VM.
On 23-Dec-05, at 1:34 PM, Cowdery, Bob [UK] wrote:
I am sure this must be obvious but I can’t find it. How do I determine programmatically which OS I am running on.
Thanks
Bob
*** Confidentiality Notice *** Proprietary/Confidential Information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply email.
-- ======================================================================== === John M. McIntosh johnmci@smalltalkconsulting.com 1-800-477-2659 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com ======================================================================== ===
squeak-dev@lists.squeakfoundation.org