0

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?

Michael
  • 1,055
  • 1
  • 16
  • 31
  • 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. – Jim K Feb 04 '22 at 19:23
  • @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? – Michael Feb 04 '22 at 22:54
  • 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. – Jim K Feb 05 '22 at 22:05

0 Answers0