Score:0

Why are some of my .odt files plain XML while most are ZIP files?

cn flag

It was my understanding that an ODT file was a ZIP file that contains various files that comprise an OpenOffice / LibreOffice document. However, I was running a script to search through these files when I noticed that I was getting an error from some of my ODT files about an end of central directory signature not being found. When I looked at these files I discovered that they were in fact plain XML.

Is this expected? What determines whether ZIP or XML is used? Is there some mechanism I can use to easily determine which type of file an ODT file is, aside from simple checking if unzip fails?

Jim K avatar
lu flag
In the LibreOffice Save As dialog, files can be saved as type Flat XML ODF Text Document, which defaults to extension `.fodt`. It sounds like these files may be of that type but were named `.odt` instead for some reason. Checking if unzip fails sounds like a reasonable solution to me. The script could rename them if that happens.
cn flag
@JimK Is it possible this would happen if the files were created using "touch" (to create a 0 length file) and then opened in LibreOffice as a shortcut to going through all the dialog stuff to do the initial save?
Jim K avatar
lu flag
When I tried what you just described, the result was an ordinary `.odt` file that must be unzipped. Beyond that, it doesn't seem helpful for me to speculate on how the files may have been created. Perhaps you could ask whoever created them.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.