• 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: Getting user and group names from user and group IDs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Getting user and group names from user and group IDs (From: Ken Tozier <email@hidden>)

  • Prev by Date: Getting user and group names from user and group IDs
  • Next by Date: Re: Superimpose a NSTextField over NSImageView? [SOLVED]
  • Previous by thread: Getting user and group names from user and group IDs
  • Next by thread: getting raw data from image.
  • Index(es):
    • Date
    • Thread