Results 1 to 2 of 2

Thread: QFile write and file modyfication time

  1. #1
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default QFile write and file modyfication time

    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
    Last edited by Talei; 9th May 2010 at 04:11.

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QFile write and file modyfication time

    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.

Similar Threads

  1. QFile - QDataStream read and write each character
    By nhs_0702 in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2010, 19:03
  2. How to write a date and time of compiled
    By TomASS in forum Newbie
    Replies: 1
    Last Post: 13th December 2009, 19:14
  3. possible open/write two files same time with QFile
    By npotency in forum Qt Programming
    Replies: 4
    Last Post: 15th November 2009, 00:28
  4. Unable to write to file QFile
    By cuter in forum Qt Programming
    Replies: 4
    Last Post: 15th July 2009, 11:19
  5. How to write bytes read from serial port to a QFile
    By shamik in forum Qt Programming
    Replies: 19
    Last Post: 25th June 2007, 14:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.