using namespace std;
ofstream myfile;
//myfile.open ("Z:\\ABC.TXT"); // fails Z: is a network drive
//myfile.open("C:\\Temp\\ABC.TXT"); // OK
//myfile.open("Z:\\NETWORK\\02-010E.CHS"); // fails Z:\Network is a network folder
if (myfile.is_open())
cout << "file is open" << endl;
else
cout << "file fails to open" << endl;
myfile.close();
问题:似乎ofstream.open
不支持在网络驱动器上打开文件。有没有简单的方法来解决这个问题?