Re: How do I access NetInfo from Cocoa?
Re: How do I access NetInfo from Cocoa?
- Subject: Re: How do I access NetInfo from Cocoa?
- From: Douglas Davidson <email@hidden>
- Date: Tue, 9 Oct 2001 09:35:49 -0700
On Monday, October 8, 2001, at 07:01 PM, Josh M. Hurd wrote:
Here is what I came up with:
struct passwd *theUserInfo;
NSString *UID;
theUserInfo = getpwnam([[userName stringValue] cString]);
UID = [[NSNumber numberWithInt:theUserInfo->pw_uid] stringValue];
userName is a user editable TextField.
UID is an NSString because I need it in a pathname.
I would suggest not using the cString method here. Strings at the BSD
level are generally UTF8, so you should probably specify that.
Douglas Davidson