Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Accessing the username from C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing the username from C++



On Jan 5, 2006, at 2:39 PM, Don Clark wrote:
I need a way to get the login name from my C++ program, and getlogin () doesn't do it - I'm logged in and am an administrator, and getlogin() returns "root". What I really want to do is call fopen ("~/Library/Logs/ousb2log.txt", "a"); but this fails with error code 2, file does not exist.

getlogin() works fine for me, not returning "root" for non-root users. What do getuid() and geteuid() return in your program?


(You might get better answers from a Mac OS X development mailing list.)


-- Greg Parker email@hidden Runtime Wrangler


_______________________________________________ Do not post admin requests to the list. They will be ignored. Objc-language mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Accessing the username from C++ (From: Don Clark <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.