filesystem navigation in c++
-
Hi all, I've got the path to a file returned by a CFileDialog. (Let's call it "path") Now i wanna open another file in the same directory. I know the name of the file, of course. I tried with: file.open(path+"\..\newfile.txt",std::ios::in); but it tells me "not enough memory" at runtime. How can i do that ? Thanx in advance, Desmo16.
-
Hi all, I've got the path to a file returned by a CFileDialog. (Let's call it "path") Now i wanna open another file in the same directory. I know the name of the file, of course. I tried with: file.open(path+"\..\newfile.txt",std::ios::in); but it tells me "not enough memory" at runtime. How can i do that ? Thanx in advance, Desmo16.
How about... PathRemoveFileSpec(path); _tcscat(path, _T("\\newfile.txt")); file.open(path,std::ios::in); Mark
-
How about... PathRemoveFileSpec(path); _tcscat(path, _T("\\newfile.txt")); file.open(path,std::ios::in); Mark
-
The compiler tells me PathRemoveFileSpec(path); identifier not found even with a research independent from the object is there anything i should include ? Thanx in advance, Desmo16.
#include Removes the file name and backslash from the end of a pathname string. Mark
-
#include Removes the file name and backslash from the end of a pathname string. Mark
-
Sorry damn little angle brackets in html :doh: #include
-
Hi all, I've got the path to a file returned by a CFileDialog. (Let's call it "path") Now i wanna open another file in the same directory. I know the name of the file, of course. I tried with: file.open(path+"\..\newfile.txt",std::ios::in); but it tells me "not enough memory" at runtime. How can i do that ? Thanx in advance, Desmo16.
In additional you can use of CFile instead file.open:)
WhiteSky