PDA

View Full Version : Problem in QDom xml



wagmare
15th March 2012, 16:20
Hi,
I am facing problem in XML file updation.
How to replace one line or insert new line in existing XML file without overwriting whole file, using QDomDocument and QFile. I had tried to replace a line in xml file with new line(new line size is less than original line size). But the extra chars from original line are not deleted.


Please help Thanks in advance.

wysota
15th March 2012, 20:52
You can't. The concept of files used in current computer systems dictates that you can't insert new data in the middle of the file. To do that you need to overwrite all the following bytes. The same happens when the file gets shorter -- you need to overwrite the contents until the very end and then truncate the rest of the file.