• 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: Cocoa way to get list of user accounts?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa way to get list of user accounts?


  • Subject: Re: Cocoa way to get list of user accounts?
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 11 Mar 2008 08:51:40 +0100

As far as I know, the only reliable way to get users accounts is to use DirectoryServices but Apple do not provide Obj-C API for Directory Services.
There is an obj-C wrapper in the DSTools project of Darwin (http://www.opensource.apple.com/darwinsource/ ), so you may have a look at it.
Anyway, do not try to parse system files, you result will be wrong. For example, you think you users are stored in /etc/passwd, so you probably don't know /var/db/dslocal ;-) and you also have to be aware that the local user list storage has change between 10.4 and 10.5



Le 11 mars 08 à 07:00, Mac QA a écrit :

Hi,

I am seeking the nice clean Cocoa way of getting a list of user
accounts on the local system. Ultimately in the form of an NSArray of
NSStrings of user account short names. There must be a way without
parsing obscure system files, or spawning off NSTasks and parsing
output, right? Any and all suggestions greatly appreciated. Thanks!
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Cocoa way to get list of user accounts?
      • From: "Mac QA" <email@hidden>
References: 
 >Cocoa way to get list of user accounts? (From: "Mac QA" <email@hidden>)

  • Prev by Date: Re: Creating an NSSocketPort on an available port?
  • Next by Date: Re: Cocoa way to get list of user accounts?
  • Previous by thread: Cocoa way to get list of user accounts?
  • Next by thread: Re: Cocoa way to get list of user accounts?
  • Index(es):
    • Date
    • Thread