Calling BSD from Cocoa and/or CFM?
Calling BSD from Cocoa and/or CFM?
- Subject: Calling BSD from Cocoa and/or CFM?
- From: Zack Morris <email@hidden>
- Date: Mon, 21 Jan 2002 16:52:57 -0700
Hi, I am new to the list and have a newbie question (for future
reference, is there a better list to ask about pure OS X questions?). How
do I call BSD UNIX routines from OS X? Specifically, I need to call
getpwent() which is inside the pwd.h header. You can read about it by doing
a "man getpwent" search in google. For some reason it didn't show up in man
on my computer. I have searched my drive and cannot find the pwd.h file or
getpwent in the contents. I downloaded the developer tools but that did not
help. I assume that I need to download and install some unix libraries, but
I don't know how. I know that the routine exists because I can call it from
perl on the command line. Here is my test file called "getnames.pl":
#!/usr/bin/perl
setpwent();
while( 1 )
{
@newuserpw = getpwent();
if( @newuserpw != 0 )
{
printf "@newuserpw\n";
}
else
{
last;
}
}
from the command line:
perl getnames.pl
It then outputs a list of users on this machine. I just need a way to call
it from c++, preferrably from codewarrior. Also, how do I do a lookup on
the name and call it from a carbon CFM project (similar to RezLib's method
of calling CF... routine for setting resolution). I am using OS X 10.1.2
Build 5P48. Thank you for your time,
Zack Morris
Z Sculpt Entertainment
email@hidden
http://www.zsculpt.com