PDA

View Full Version : QFile write and file modyfication time



Talei
9th May 2010, 04:05
Hello,
I want to make exact file copy, including last modify time (same as on OS, when You copy file at least last modify time is the same as source), but using Qfile write I can't achieve that.
Any idea how to do that?

ATM I use QFile dst.write( QFile src.read() );, tried also with QFile::copy(), but either don't preserve modification time. WinXpSP3

Thanks in advance

Talei
9th May 2010, 20:46
After some "googling" around, according to bug-track on nokia, http://bugreports.qt.nokia.com/browse/QTBUG-10337 , copy don't preserve creation/modification time, so I assume write either.
Right now I need to fall back to WinAPI SetFileTime and probably I would be better writing write function OS specific.
Can someone point me where can I find equivalent to the SetFileTime on Linux.