Re: Getting user and group names from user and group IDs
Re: Getting user and group names from user and group IDs
- Subject: Re: Getting user and group names from user and group IDs
- From: Axel Andersson <email@hidden>
- Date: Tue, 25 Apr 2006 11:39:33 +0200
On Apr 25, 2006, at 11:22, Ken Tozier wrote:
I'm writing a replacement for [NSFileManager fileAttributesAtPath]
to return some additional info I need for my app and have
everything working except conversion of user and group ids to their
corresponding user and group names.
I Googled for several hours but couldn't seem to find anything that
does it except the command line "ls -l <file path>" command.
Looking at the man page for ls, I didn't see any way to just return
these two pieces of information and I'd rather not have to get into
parsing strings. Is there some Carbon or Cocoa function that allows
for these types of conversion?
Sounds like you need getpwuid()/getgrgid():
http://developer.apple.com/documentation/Darwin/Reference/ManPages/
man3/getpwuid.3.html
http://developer.apple.com/documentation/Darwin/Reference/ManPages/
man3/getgrgid.3.html
-- Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden