Monday, June 09, 2008

index.xml.gz and corruption

Under certain non-identified circumstances the file index.xml.gz can be corrupted. According to posts in Apple's discussion forums by Yvan Koenig, who usually knows what he is talking about, the corruption can be avoided by using Save As... instead of Save. The conclusion is to make frequent Save As... actions as backups, if you work on important large documents.

To rescue some information from a corrupted document, you can right click (ctrl-click) on the corrupted document and choose "Show package content" and look for a file called index.xml or index-new.xml. Copy the xml file to the desktop (for example) and open it with TextEdit. The content does not look nice, but text you have entered is partly readable.

If you only have a file called index-new.xml you can try the following steps:
  1. Copy the entire corrupted document, so you have a backup just in case.
  2. Rename the file index-new.xml to index.xml (with or without gz depending on the original).
  3. Open the file in Pages.
If you are lucky that works.