No, "\text.txt" is a valid file name, just as ".\text.txt" or "..\text.txt" are - they are relative filename not absolute filenames, but nevertheless, valid.
This is a discussion on open file error within the Windows Programming forums, part of the Platform Specific Boards category; No, "\text.txt" is a valid file name, just as ".\text.txt" or "..\text.txt" are - they are relative filename not absolute ...
No, "\text.txt" is a valid file name, just as ".\text.txt" or "..\text.txt" are - they are relative filename not absolute filenames, but nevertheless, valid.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
no, ".\text" is a name with . + tab + "ext.txt", which is not valid.Use any character in the current code page for a name, including Unicode characters, except characters in the range of zero (0) through 31, or any character that the file system does not allow. A name can contain characters in the extended character set (128–255). However, it cannot contain the following reserved characters:
< > : " / \ | ? *
Last edited by robwhit; 12-19-2007 at 05:28 PM.
It's a path. Though I don't know if CreateFile will interpret an absolute path or directory of if it will just accept a filename in the current directory.
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
Ummmm...
No it is not.
A '\' is not a character. A '\' requires a second character in all cases.
'.\\' or '..\\' is a path
As Robwhit said, the compiler reads '\t' as a TAB, making '.\text.txt' == '. ext.txt'
I suggest you try this in your compiler and report your results.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
And why don't you just use CFile and CArchive if you are using MFC in the first place??
We're talking about real paths here, now how you type them in your compiler
Obviously, in a C++ string, you'd have to type ".\\text.txt", which would translate to ".\text.txt".
Now there's something I just can't agree less with.And why don't you just use CFile and CArchive if you are using MFC in the first place??
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
Alright, no harm done![]()
For information on how to enable C++11 on your compiler, look here.
よく聞くがいい!私は天才だからね! ^_^