I am using the following code to open a text file
CStdioFile f;
CString sPath = "E:Foldertest.txt"
//Open the text file
if (f.Open(sPath, CFile::modeRead))
{
int i = 0;
}
This works.
However the text file I need to read is located in the C: drive. If I set sPath to “C:Foldertest.txt” the program no longer opens the file. Note that the program itself is located in the E: drive.
I verified that the user running the program has read access to C:Foldertest.txt. I would expect to be able to open this file given that the user has read permissions, but I am unable to do so.
Joe F is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.