Probably a private function. Anyway, not really hard to implement:
#include <pwd.h>
mbr_user_name_to_uuid(const char *username, uuid_t uuid) {
struct passwd *info = getpwnam(username);
if (info)
mbr_uid_to_uuid(info->pw_uid, uuid);
}
Le 25 juin 08 à 13:38, Yoann GINI a écrit :
A friend have teach me this options after send my mail, and in dsmbrutil.c I've found mbr_user_name_to_uuid() rather than mbr_uid_to_uuid(), but I haven't find mbr_user_name_to_uuid() in membership.h :-(But I take note of that "look in Darwin's code" :-) Le 25 juin 08 à 12:47, Michael Watson a écrit :Jean-Daniel already provided an answer, but it's worth reminding people that the source code to many of the utilities that come with Mac OS X is available for dissection, including the Directory Services utilities:http://www.opensource.apple.com/darwinsource/10.5/DSTools-109/dsmbrutil/dsmbrutil.cIf you can do it on the command-line with an open-source tool, you can extract the original code and use it directly. Your application will perform better, it will have fewer external tool version dependencies, and you can customize the data all you like without performing any additional shell tool parsing.-- m-s On 25 Jun, 2008, at 05:22, Yoann GINI wrote:Hi all,I look for get the UUID of the current user, the only way actually found is to run a NSTask with this command : "dsmemberutil getuuid -U `whoami`"... But it's not really a good solution for me.Have you a idea for get the UUID without NSTask ? Thanks in advance, Yoann _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/mikey-san%40bungie.org This email sent to [EMAIL PROTECTED]_______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/yoann.gini%40inig-services.com This email sent to [EMAIL PROTECTED]_______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/devlists%40shadowlab.org This email sent to [EMAIL PROTECTED]
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list ([email protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
