Re: How to determine user name from within C++ on linux
- From: Carlos Moreno <moreno_at_mochima_dot_com@xxxxxxxxxxxxxx>
- Date: Fri, 05 May 2006 09:20:55 -0400
consultmac2 wrote:
Using c++ via gcc on Fedora Core 3:
For our project, we want to create a temp directory for the current
user if it does not already exist; something like /tmp/consultmac2.
Our program will write, read and ultimately delete files from that
directory, and eventually delete the directory as well.
How does one capture the logged-on user name from within c++ so we
can do that?
getenv, perhaps?
Or perhaps you would prefer to choose a directory name at random?
(look up /dev/urandom).
HTH,
Carlos
--
.
- Follow-Ups:
- References:
- How to determine user name from within C++ on linux
- From: consultmac2
- How to determine user name from within C++ on linux
- Prev by Date: Re: How to determine user name from within C++ on linux
- Next by Date: Re: How to determine user name from within C++ on linux
- Previous by thread: Re: How to determine user name from within C++ on linux
- Next by thread: Re: How to determine user name from within C++ on linux
- Index(es):