Re: Checking OS Version with Cocoa
Re: Checking OS Version with Cocoa
- Subject: Re: Checking OS Version with Cocoa
- From: Bill Cheeseman <email@hidden>
- Date: Sat, 04 Jan 2003 21:48:23 -0500
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.