How to detect Classic?

Thomas J McGrath III 3mcgrath at adelphia.net
Fri Jan 16 09:26:08 EST 2004


Since OS9 is no longer supported in Panther, The way "Classic" is 
handled is completely different in 10.2.3 +.
I ran into this and had a couple of workarounds for the path.
It would be nice to have a simple way of finding the true platform and 
environment we are running in.

Tom

On Jan 16, 2004, at 7:39 AM, Jan Decroos wrote:

>
>
> You can check which environment your application is running by 
> checking the
> processID, which returns the real process ID if running under OS X (it 
> must
> appear in the first column of the result of 'ps -c -U myAccountName'), 
> and it
> returns 9000 if running under Classic.
> (Every application started under Classic is a sub-process (AFAIK) of
> TruBlueEnvironment (Mac OS 9 Classic), and you don't find the value of 
> the
> processID function back in the first column.)
>
>
> on mouseUp
>   if isRunningClassic() then
>     answer "Classic"
>   else
>     answer "OS X"
>   end if
> end mouseUp
>
> function isRunningClassic
>   set the itemDel to "/"
>   put last item of $HOME into myAccountName
>   get((CR&space&space&(the processID)&space) is in (CR&shell("ps -c -U
> "&myAccountName)))
>   return not(it)
> end isRunningClassic
>
> Regards,
> Jan
>>
>>
>> I have an app that I built for both PPC & OS X. The 2 systems handle
>> file paths differently so I have a routine to convert from one to the
>> other depending on "the systemVersion". The problem is that I was
>> testing the PPC version using Classic from inside OS X. My conversion
>> routine wasn't working so none of the expected files could be found. I
>> finally tracked this down to the fact that when running in Classic as
>> opposed to having booted into OS 9, the systemVersion still returns
>> 10.3.2
>>
>> So the Rev engine thought it was still operating in OS X but insisted
>> on OS 9 file paths! Does anyone have any ideas on how to detect when 
>> an
>> OS 9 app is running in Classic? I guess if not, I'll just have to do
>> separate builds for each version with the system type stored in a
>> custom property.
>>
>> Cheers,
>> Sarah
>> sarahr at genesearch.com.au
>> http://www.troz.net/Rev/
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>

Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev 
2.1.2


Advanced Media Group
Thomas J McGrath III	• 2003 •	3mcgrath at adelphia.net
220 Drake Road, Bethel Park, PA 15102





More information about the use-livecode mailing list