Results 1 to 4 of 4

Thread: Writing single line inside a text file

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Writing single line inside a text file

    Yes, entire files are rewritten when you update a sequential file. The Microsoft .docx file is a zipped XML file, i.e. effectively text, and operates the same way.

    By treating a text file as a random-access binary file you can perform some limited in-place updates of mid-file content but nothing that changes the size of the portion you are replacing. The Qt binary installer does something like this to update the various Qt install paths embedded in the Qt libraries: corelib/global/qconfig.cpp holds a preallocated, fixed-size buffer for each path and the installer writes the actual installed path into that space in the QtCore library binary file without rewriting the entire file.

  2. The following user says thank you to ChrisW67 for this useful post:

    Momergil (17th July 2013)

Similar Threads

  1. Start writing from a specific line in a file
    By nackasha in forum Newbie
    Replies: 1
    Last Post: 17th August 2011, 18:31
  2. writing in text file
    By ready in forum Qt Programming
    Replies: 3
    Last Post: 3rd July 2011, 23:20
  3. New line when writing a File
    By locke in forum Qt Programming
    Replies: 5
    Last Post: 17th May 2011, 12:27
  4. Writing the text within a text edit to a file
    By Splatify in forum Newbie
    Replies: 4
    Last Post: 23rd February 2011, 23:48
  5. writing to a text-file
    By QtBros61 in forum Newbie
    Replies: 7
    Last Post: 9th April 2010, 12:15

Tags for this Thread

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.