PDA

View Full Version : File Management



Arshia Aghaei
1st July 2015, 06:22
How to work with file (Output , Input) in Qt 5 ??? (Solved)
I know that i can do this with QFile class , but i don't know about working with the functions and streams. (Solved)
My app hangs after the File management code.
My code is the following , notice that the code is a very low-power antivirus solution :


QFile VirusScanner(Current);
while(!VirusScanner.atEnd()) {
QString Line = VirusScanner.readLine();
if(Line.toLower() == "open=regsvr.exe" || Line.toLower() == "open=newfolder.exe") {
cout << "Autorun.inf virus detected. Deleteing..." << std::endl;
const QString Virus_Path = VirusScanner.fileName();
VirusScanner.close();
QFile::remove(Virus_Path);
}
}

jefftee
1st July 2015, 06:29
Start by reading the documentation for QFile.