Operation IO on files
-
I have problem i read from file that
@//Odzczyt plikuQFile file_2("D:\\Prosit\\veryf.txt");// QFile file_2("veryf.txt");
if (!file_2.open(QIODevice::ReadOnly | QIODevice::Text))
return;QTextStream in(&file_2); while (!in.atEnd()) { QString zm_ver = in.readLine(); ui->line_veryf->setText(zm_ver); file_2.close(); QFile::remove("D:\\Prosit\\veryf.txt");@
And on Win7 all is working
On one XP working without full path (comment)
On second Xp dont working with full path or without full pathSomeone have any idea
Thanks for help -
Welcome to this forum
Without knowing the file structures on your PCs it is difficult to give a proper answer.
However, the first suggestions would be to check the existence of the files.
The D drive is usually not on all systems.
How about the directory?
Is the file present, where you assume it should be? -
Qt always uses '/' as a path separator for filenames, but that should not effect your code.
Have you tried using QFile's error(...) method to find out why the open failed?
-
Problem is exist with amplication which have trigers on catalog. I make bat file and add to triger which copy files to another folder and i read and all is ok. This strange becouse if I use anothers programs i try with OpenOffice make some docs read write and all is worked...
Is exist any other mechanism to operations on files in QT ??
This is problem if which can give some problems with programs like antivirus -
So what is the error QFile reports? That should give a good hint as to what is causing the issue.