hi, everyone,
i have a question to ask you. it's about QFile. my code is:
QFile file("/proc/mounts");
if (!file.exists())
{
qDebug() << "exist error" << file.error();
file.close();
return 0;
}
{
qDebug() << "open error" << file.error();
file.close();
return 0;
}
.......
file.close();
QFile file("/proc/mounts");
if (!file.exists())
{
qDebug() << "exist error" << file.error();
file.close();
return 0;
}
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
qDebug() << "open error" << file.error();
file.close();
return 0;
}
.......
file.close();
To copy to clipboard, switch view to plain text mode
when i open the file some times, and then it printf "open error 4" ,4 means QFile::ResourceError,what's the problem.
thanks!
Bookmarks