• 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: Calling BSD from Cocoa and/or CFM?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling BSD from Cocoa and/or CFM?


  • Subject: Re: Calling BSD from Cocoa and/or CFM?
  • From: Zack Morris <email@hidden>
  • Date: Wed, 23 Jan 2002 00:12:40 -0700

on 1/21/02 5:37 PM, James Montgomerie at email@hidden wrote:

> This works for me...
>
> #include <stdio.h>
> #include <pwd.h>
>
> int main (int argc, const char * argv[]) {
> struct passwd *pwd;
> do {
> pwd = getpwent();
> if(pwd && pwd->pw_name) {
> printf("User: %s\n", pwd->pw_name);
> }
> } while(pwd);
> return 0;
> }

Wow! Thanx for the quick reply! I got it all working in PB and CW.
The CFM importing is trivial after looking at CallMachOFramework. I am
stuck on one last problem, which is how to search the frameworks for a
function ptr. The example says to load the bundle for "System.framework"
but evidently that's not where getpwent is stored. I was able to import a
bunch of other bsd commands, so I know it's almost working. The example
says to use "nm" from the command line to see which functions are in which
libraries, and I did get it to work for single libraries, but I really need
to search the whole frameworks folder for "getpwent". I even tried a trial
and error by adding IOKit.framework, and others (instead of
System.framework). I am looking for a solution other than changing
permissions to get sherlock to work. Oh, and man works now, I just had
never tried it after the dev tools install. Thank you for your time,

Zack Morris
Z Sculpt Entertainment
email@hidden
http://www.zsculpt.com


  • Follow-Ups:
    • Re: Calling BSD from Cocoa and/or CFM?
      • From: Finlay Dobbie <email@hidden>
    • Re: Calling BSD from Cocoa and/or CFM?
      • From: Zack Morris <email@hidden>
References: 
 >Re: Calling BSD from Cocoa and/or CFM? (From: James Montgomerie <email@hidden>)

  • Prev by Date: Re: NSGlyph is still a puzzle
  • Next by Date: Re: Question about movePath
  • Previous by thread: Re: Calling BSD from Cocoa and/or CFM?
  • Next by thread: Re: Calling BSD from Cocoa and/or CFM?
  • Index(es):
    • Date
    • Thread