On Tue, Sep 03, 2013 at 01:48:46PM +0200, Goubier Thierry wrote:
Le 03/09/2013 13:36, David T. Lewis a ?crit :
On Tue, Sep 03, 2013 at 01:15:01PM +0200, Goubier Thierry wrote:
I'm attempting something. Is is OK if I save in the OSProcess squeaksource repository?
Thierry
Can you post the method here first? I'd like to check it on some Squeak images before it goes into the repository.
Here it is (at least an example):
Thank you! I will check this when I get home this evening. Dave
in OSProcess class
isPharo3AndLater "Test if we are on Pharo 3.0"
^ (Smalltalk classNamed: 'SystemVersion') ifNil: [ false ] ifNotNil: [ :v | v current type = 'Pharo' and: [ v current major >= 3 ] ]
platformName "After Squeak version 3.6, #platformName was moved to SmalltalkImage Some versions of Pharo move this to OSPlatform and issue deprecation warnings about the other usages. Then Pharo moved away from OSPlatform and deprecated its use."
"self platformName"
self isPharo3AndLater ifTrue: [ ^ Smalltalk os name ]. ^ (((Smalltalk hasClassNamed: #OSPlatform) and: [(Smalltalk at: #OSPlatform) respondsTo: #platformName]) ifTrue: [Smalltalk at: #OSPlatform] ifFalse: [((Smalltalk classNamed: 'SmalltalkImage') ifNil: [^ Smalltalk osVersion]) current]) platformName