• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Checking OS Version with Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: Checking OS Version with Cocoa
      • From: MarketLogix Developer <email@hidden>
References: 
 >Re: Checking OS Version with Cocoa (From: MarketLogix Developer <email@hidden>)

  • Prev by Date: Re: "Delete" icon as a menu item shortcut
  • Next by Date: Re: Checking OS Version with Cocoa
  • Previous by thread: Re: Checking OS Version with Cocoa
  • Next by thread: Re: Checking OS Version with Cocoa
  • Index(es):
    • Date
    • Thread