Prevent opening file stream with incorrect case of letters

F

Fraser Ross

I want to prevent std::basic_ifstream from opening a file for reading when
it is passed the file name with any wrong case of a letter. If that can't
be done is there anything else that could be done before opening? The
program is for Windows.

Fraser.
 
M

Martijn Lievaart

I want to prevent std::basic_ifstream from opening a file for reading when
it is passed the file name with any wrong case of a letter. If that can't
be done is there anything else that could be done before opening? The
program is for Windows.

Easy. Just check the string containing the filename if it has the right
case. I suspect you mean that it should match the case of the file as it
appears in the directory though, and for that you'll have to look for
answers in a Windows oriented group.

HTH,
M4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top