LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 02-04-2005, 06:36 PM   #1
Simon_6162
Member
 
Registered: Jul 2004
Location: UK
Distribution: Fedora, Gentoo, Redhat Enterprise
Posts: 141

Rep: Reputation: 16
find users home dir c++


Hi all,

I'm writing a program that need to store data in an ini file. All I would like to know is how do i find the path to a users hoem directory in C++.

ie i want to save the file ~/.file.ini but need to know how to find what ~ actually is.


thanks in advance

Simon
 
Old 02-04-2005, 06:47 PM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Code:
char *homedir;
homedir = getenv("HOME");
 
Old 02-04-2005, 07:53 PM   #3
Simon_6162
Member
 
Registered: Jul 2004
Location: UK
Distribution: Fedora, Gentoo, Redhat Enterprise
Posts: 141

Original Poster
Rep: Reputation: 16
thanks, I've been looking for that for a while now !
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't write to home dir. Mirari Linux - General 5 05-22-2005 02:42 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM
Restricting FTP Users to their home dir in vsftpd ~ForgottenFlux~ Linux - Software 2 09-03-2003 07:54 PM
how would i safely lock users to thier home dir? f1uke Linux - Security 2 07-22-2003 01:23 AM
FTP Users Go to There Home Dir FS2003 Linux - Networking 1 07-11-2003 01:28 PM


All times are GMT -5. The time now is 06:43 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration