← Back to team overview

gtg team mailing list archive

[Bug 579189] Re: tags.xml is sometimes deleted

 

Changes:

1. Now, instead of just rewriting main XML file, we rename main file to temp one and than write to main.
2. Instead of using f.write(), we use os.write(). This enables us to check if writing was successful or not.
3. When reading, if something is wrong to main file, we will use temp one (in case it exists).
4. When reading file, we open it as read only and close it after reading.

What was tested:

1. Simple stuff (adding new tasks, deleting, adding new tags)
2. Copying main file to temp file and than removing main file (emulating error behaviour).
3. Copying main file to temp file and than breaking main file (emulating error behaviour).

** Patch added: "file_reading_and_writing.patch"
   http://launchpadlibrarian.net/48704696/file_reading_and_writing.patch

-- 
tags.xml is sometimes deleted
https://bugs.launchpad.net/bugs/579189
You received this bug notification because you are a member of Gtg
contributors, which is subscribed to Getting Things GNOME!.

Status in Getting Things GNOME!: Confirmed

Bug description:
Getting Things Gnome! 0.2.4
LinuxMint 7.

yuriy@ynix ~ $ /home/yuriy/YuriyInstalledSoft/gtg-0.2.4/gtg
Error parsing XML file /home/yuriy/.local/share/gtg/tags.xml: no element found: line 1, column 0

The size of tags.xml file is 0. It is empty.
Fortunately I have had backup of my config files and restored tags.xml.





References