Re: Checking OS Version with Cocoa
Re: Checking OS Version with Cocoa
- Subject: Re: Checking OS Version with Cocoa
- From: MarketLogix Developer <email@hidden>
- Date: Sat, 4 Jan 2003 20:19:46 -0800
Hi.
I'm new here and I must confess that I do not yet know the
exact description of Cocoa. I suppose that it equates to the
proprietary extensions, ie. Frameworks that Apple has added
to the (GNU) ObjC language. Plus libaries of Classes of course.
But if you wish to dial that back to ObjC in general then I'll tell you
...
I have a buttload of ObjC code (Gnu-based) that is fully ported to:
FreeBSD
Linux
Sun Solaris
win32 (using cygwin)
NeXTStep
OpenStep
and most recently ...
OSX
Know why ?
Didn't lock into proprietary extensions when it could easily
be avoided. I still think that thats sound advice.
Besides, I believe that the thread started out in quest of the "OS"
version.
No ?
So now let me guess, this where you tell me that I'm off topic ;)
bisk
On Saturday, January 4, 2003, at 06:48 PM, Bill Cheeseman wrote:
on 03-01-04 9:04 PM, MarketLogix Developer at email@hidden wrote:
I suggest the portable way when possible:
int platform( char *platformBuff )
{
struct utsname platform;
bzero(&platform,sizeof(platform));
if ( uname(&platform)<0 )
return errno;
sprintf(platformBuff,"<OS:%s>-<REV:%s>-<CPU:%s>",
platform.sysname, platform.release, platform.machine
);
return 0;
}
make sure that platformBuff can hold at least 32 bytes ...
This will compile & run under linux, FreeBSD, Sun Solaris (2.6
anyway) and
OSX.
I love it! And how many Cocoa apps are running on Linux, FreeBSD and
Sun
Solaris today?
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont - http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.