Copying CSV file from linux to pendrive causes format change how to fix it ?
-
wrote on 16 Feb 2023, 13:03 last edited by
This is my Code ,
const QString srcPath = QFileDialog::getOpenFileName(this, "Source file", "/home/pi/git/build-UI-Desktop-Debug/", "csv files (*.csv)"); if (srcPath.isNull()) return false; QString name = "Data.csv"; QString dstPath = QFileDialog::getSaveFileName(this, "Destination file", "/media/pi/" + name, "All files (*.*)"); if (dstPath.isNull()) return false; if (QFile::exists(dstPath)) if (!QFile::remove(dstPath)) return false; return QFile::copy(srcPath, dstPath);
Output :-
-
This is my Code ,
const QString srcPath = QFileDialog::getOpenFileName(this, "Source file", "/home/pi/git/build-UI-Desktop-Debug/", "csv files (*.csv)"); if (srcPath.isNull()) return false; QString name = "Data.csv"; QString dstPath = QFileDialog::getSaveFileName(this, "Destination file", "/media/pi/" + name, "All files (*.*)"); if (dstPath.isNull()) return false; if (QFile::exists(dstPath)) if (!QFile::remove(dstPath)) return false; return QFile::copy(srcPath, dstPath);
Output :-
wrote on 16 Feb 2023, 14:41 last edited by@Ramkumar-Mohan
What is a "format change"?What did the user enter as source & destination file names/paths? How do we know where/what the file you show in the screenshot is?
QFile::copy()
should just do a copy. Have you checked a byte-by-byte comparison tool to see if the source & destination files are identical? -
wrote on 16 Feb 2023, 14:57 last edited by
This looks to me like the copy is still in progress. Maybe its a very large file and you need to give it some time to complete.
-
This looks to me like the copy is still in progress. Maybe its a very large file and you need to give it some time to complete.
wrote on 16 Feb 2023, 15:05 last edited by@mranger90
Surely the OP would have allowed for that before posting?! :)
1/4