LinuxQuestions.org
Visit Jeremy's Blog.
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 07-05-2004, 12:01 PM   #1
qcoder
Member
 
Registered: Oct 2003
Location: United States
Distribution: Debian
Posts: 65

Rep: Reputation: 15
Question opening file in home dir with C++


I am writing a program and I want it to be able to open a file from the users home directory. if the program is in /bin or somewhere how would I do that?
I have tried somthing like ofstream(~/thefile); but that doesn't seem to work.
 
Old 07-05-2004, 12:19 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
~ is just a shell completititon variable that sh uses.

see "man getenv"
 
  


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
a phantom file in my home dir microsoft/linux Debian 16 11-05-2005 10:54 PM
C - Opening a Status file in user's home dir. pentalive Programming 10 06-09-2005 09:53 AM
Konqueror: Icons/file names don't show up for home dir jlangelier Linux - Software 3 12-10-2004 02:54 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM
home dir vsftpd ilengna Linux - Networking 7 10-14-2003 07:58 PM


All times are GMT -5. The time now is 08:44 PM.

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