Results 1 to 4 of 4

Thread: QFile Seeking / Overwriting

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2008
    Location
    UK
    Posts
    35
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1

    Default Re: QFile Seeking / Overwriting

    Quote Originally Posted by ^NyAw^ View Post
    Hi,

    Maybe you have to read the file to a QByteArray and overwrite the date on it. Then you have to save the file with this new data.
    Thanks, but the file in question might be > 4GB in size, so i cant really read it all and process it due to performance reasons. Im pretty sure it can be done in standard C but i was wondering if Qt had a way to do it.

  2. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    70
    Thanked 59 Times in 57 Posts

    Default Re: QFile Seeking / Overwriting

    Hi,

    Open the QFile and use a QDataStream on it. Then you can use:

    bool QIODevice::seek ( qint64 pos )
    Òscar Llarch i Galán

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
  •  
Qt is a trademark of The Qt Company.