Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File problem (n00b question)

Status
Not open for further replies.

FORAND

Programmer
Joined
May 26, 2003
Messages
64
Location
CA
Code:
ofstream poubelle;  

poubelle.open("DUMP.TXT"); 
poubelle<<&quot;Programme : Purge Queue Garbage pour MPS\n&quot;; 
poubelle<<&quot;blablablablablalba\n&quot;;

How can i open DUMP.TXT in an other directory?
it is currently open in c:\PGQ\DUMP.TXT
but i'd like it to be in c:\PGQ\DUMP\DUMP.TXT

hElP
 
#include windows.h> and use function
SetCurrentDierctory(&quot;your directory name&quot;); before opening your file, or put full path instead of only file name.

Ion Filipski
1c.bmp

ICQ: 95034075
AIM: IonFilipski
filipski@excite.com
 
>i'd like it to be in c:\PGQ\DUMP\DUMP.TXT

poubelle.open(&quot;c:\\PGQ\\DUMP\\DUMP.TXT&quot;);

/Per

if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top