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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ifstream filename problem

Status
Not open for further replies.

hedgracer

Programmer
Mar 21, 2001
186
US
I have the following path and filename in an ifstream line:

"d:\capl files\capl.dat"

This is not working. I also put \\ instead of \ and that did not work. Any suggestions? Thanks in advance.

Dave Christman
 
why didn't work? what did you get strange? John Fill
1c.bmp


ivfmd@mail.md
 
Hi,
I think the problem is not only the "\" but also the space

try this


"d:\\capl\ files\\capl.dat"

Matt
 
Looks like problem with the space
between capl and files.

abp :cool:
 
What happens is the file is not read and outputted to another file. This works when I use the following:

"d:\\capl1.dat";

The subdirectory (capl files) seems to be the problem.

Dave Christman
 
Right, it IS the directory. File paths with spaces need the space "escaped" with the "\"

When using "capl files" you need to type it in as
"capl\ files" so the space is recognized.

Matt
 
I never had problems with spaces on file names. John Fill
1c.bmp


ivfmd@mail.md
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top