[Tutorial] How to find and un-delete AOO/LO temporary files

Forum rules
No question in this section please
For any question related to a topic, create a new thread in the relevant section.
Post Reply
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

[Tutorial] How to find and un-delete AOO/LO temporary files

Post by John_Ha »

If you have lost a file, or you have a file which is full of ######, or you have a file which is corrupted beyond repair; and you want to find earlier versions of it or un-delete the temporary files AOO wrote while you were editing the file (which are copies of the file) then STOP USING THE PC and DO NOT POWER IT OFF until you have recovered the file so as to maximise your chance of success.

These techniques only work if you have previously saved the document, or if you have enabled AutoRecovery and an AutoRecovery save has taken place. When you edit a new file the document is stored in the PC memory and the document is not written to disk until you save it, or until an AutoRecovery save takes place.

See Why is my Writer file full of #####? below for an explanation of files full of null characters. Such files, whether .odt, .ods or .odp, always open with Writer and display as ######.
 Edit: Utilitaire de réparation de fichier ODF (Utility to repair ODF files) on the French forum has a utility which can repair some corrupted files. It will not repair files full of #### but, if you have a truncated file, it may be able to recover what is left in the file. Use Google Translate to translate the instructions.

See [Tutorial] ODF repair tool] for instructions on using the utility.

How do I know if my .od* file is truncated?

See the instructions here.

Thanks to cwolan and Hagar Delest for bringing it to my attention. 
The post looks complex but it is actually pretty simple - just work slowly through it. If you get stuck ask someone with better computer skills to help you, or print the instructions (File > Print ...) and take the instructions and your PC to a PC repair shop.
 Edit: This tutorial gives detailed instructions on how to:

a) use Previous Versions (W7 and later) to recover previous versions of the file (is there something similar on MacOS and Linux?);

b) recover your file as it was when you last opened or saved it; or as it was when it was last saved with AutoRecovery;

c) find previous versions of the file in the folder it is located in, but which have since been deleted;

d) find any temporary files AOO wrote while you were editing the file but which have not yet been deleted;

e) un-delete the temporary files AOO wrote while you were editing the file, and then deleted. d) and e) will recover your file as it was when you last opened or you last saved it.

It will also work for Mac users though you will need to find a Mac un-delete program.

The tutorial is often updated to add information and make clarifications. Although it was originally written based on Writer .odt files it also works for .docx files, Calc files and all AOO and LO files. I have therefore renamed the tutorial How to find and un-delete AOO/LO temporary files
...
 Edit: Using Restore Previous Versions on Windows 7 and later.

Windows 7 and later versions W8 and W10 have a Restore Previous Versions capability which, if you are very lucky, may help you to recover an earlier version of your .odt (or .doc or .rft etc) file. Basically, when a Restore Point is taken on a PC, that Restore Point saves the current copy of all files on the disk including data files. So, if all your stars are lined up, a System Restore will have been taken at the right time for you and enough space was available so that your file was saved and another System Restore has not needed some space and overwritten the one file you want and you had previously enabled Volume Shadow Copy. So, cross your fingers tightly and right-click the file > Restore Previous Versions ..., and see if any are available. Be careful not to overwrite the one you still have so make a copy with a different name.

In summary it seems that:

1. Restore Previous Versions only works if the Windows Volume Shadow Copy service is running. See How to Enable Volume Shadow Copy in Windows 7
2. A Restore Point saves one copy of each data file as it is when the Restore Point is taken.
3. If a file is edited after that Restore Point is taken, then the copy saved at the last Restore Point (and any copies still available in previous Restore Points) is available to be restored.
4. I cannot see previous versions of files I know I have edited so I guess that when System Restore runs out of space, it deletes previous Restore Points and files to make space for the new Restore Point. You can configure the space made available for System Restore in System Restore.

If you want to test Restore Previous Versions (Windows 7 and later) do the following:

1. Create a file test.txt. Type Version 1 into the file and save it as test.txt.
2. Open test.txt and edit it to read Version 2. Save it as test.txt overwriting the previous file.
3. right click test.txt. You will see there are no previous versions available.

This is because a Restore Point has not yet been taken.

4. Create a Restore Point (right click Computer > Properties > System Protection > Create). This Restore Point saves the current copy of test.txt saved on the disk - ie text.txt contains Version 2.
5. Edit test.txt so it now reads Version 3. Save it.
6. Edit test.txt so it now reads Version 4. Save it.
7. Right click test.txt > Restore previous versions. You should now be offered one Previous Version. When you choose Open it will say Version 2 - ie it is the file as it was when the Restore Point was taken. Note that you can never get back Version 3 because a Restore Point was not taken during the time Version 3 was present on the disk. 
Do you have a Solid State Disk (SSD) in your PC? If so, your chances of recovering a deleted file are poor.

Modern PCs are increasingly being equipped with Solid State Disks (SSD) because SSDs are so much faster than old fashioned rotating hard disk drives. When you have an SSD, the Operating System works silently in the background to set all the bits in deleted files to zero so, unfortunately, you may not find that many deleted temporary files! The Operating System does this because the Operating System must set all bits to zero before it can write new data to the SSD. Setting the bits to zero in the background therefore speeds future writes because the "setting bits to zero" work has already been done.

If you have a separate rotating disk you can setup AOO to write its temporary files to that disk with Tools > Options > OpenOffice > Paths ..., and set the Temporary files path to the rotating disk. AOO will now operate very slightly slower but it should be imperceptible except for very large files (many MBytes) or for files with many large images.

Can I recover .doc, .xls, .ppt files? Can I recover .docx, .xlsx, .pptx files?

Yes but .doc. .xls, .ppt files do not write temporary files.
If you are trying to recover a .odt, a .ods, a .docx or a .xlsx etc file then follow the .odt instructions.
If you are trying to recover a .doc or .xls etc file then follow the .doc instructions.


Different file types

All AOO and LO files are ZIP files. Microsoft .doc, .xls, .ppt files are OLE compound files as specified by [MS-CFB]. They open in 7-ZIP and, to a certain extent, then behave like ZIP files. Microsoft .docx, .xlsx and .pptx files are ZIP files.

Mac and Linux users

On Windows ...
  • the temporary folder is specified in Tools > Options > OpenOffice > Paths ..., and is located by default at C:\Users\xxxxxx\AppData\Local\Temp\.
  • the Backup folder is also specified in Tools > Options > OpenOffice > Paths ..., and is located by default at C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\.
On Macs ...
Use Preferences > instead of Tools > Options.
  • The temporary folder is located at /Users/xxxxxx/Library/Application Support/OpenOffice.org/4/user/temp/. In Finder use Go (menu) > Go to Folder > ~/Library/Application Support/OpenOffice.org/4/user/temp > OK. It's probably easiest to copy/paste into the Go To Folder dialog. (Check Preferences > OpenOffice > Paths).
  • The Backup folder is located at /Users/xxxxxx/Library/Application Support/OpenOffice/4/user/Backup/.
On Linux ...
  • the temporary folder is located at /home/xxxxxx/.openoffice/4/user/temp/ (Check Tools > Options > Paths).
  • The Backup folder is located at /home/xxxxxx/.openoffice/4/user/backup/.
 Edit: What happens when AOO or LO opens a file?

Opening a .odt or .docx etc file.

When you open My Documents\fred.odt, AOO takes a copy of fred.odt and places it in the C:\Users\xxxxxx\AppData\Local\Temp folder as something like C:\Users\xxxxxx\AppData\Local\Temp\sv6a8vhe.tmp\sv6a8vt4.tmp. This file is then never changed. It carries the same date and time of creation stamp as My Documents\fred.odt.

The opened document is loaded into memory. All edits and changes you make are kept in memory and none are written to disk while the file is open. Hence, if AOO or the PC crashes, you lose all your edits. The exception is adding graphics, where the graphics metadata is kept in memory (so is lost on failure) but the images themselves are written as temporary files to \Temp after the Remove from memory period has elapsed, or the allocated graphics memory has been exhausted.

AutoRecovery (note: not AutoSave!) is designed to protect you if AOO or the PC crashes. If AutoRecovery is switched ON, the first AutoRecovery creates a new file C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\fred.odt_0.odt which is the complete file (with all edits and added graphics) as it is at the time of the AutoRecovery save. This file is then updated on each AutoRecovery save and carries the time stamp of the last update. An AutoRecovery only takes place if an edit has been made and the AutoRecovery time has elapsed. AutoRecovery files get deleted by AOO when no longer needed.

I am a little unsure of the purpose of the temporary file C:\Users\xxxxxx\AppData\Local\Temp\sv6a8vhe.tmp\sv6a8vt4.tmp. As it carries the same date and time stamp as the original My Documents\fred.odt I suspect it is used to overwrite the original My Documents\fred.odt if you decide not to save any changes.

When AOO or LO closes fred.odt normally all temporary and AutoRecovery files are deleted.

Opening a .doc etc file.

Everything is the same for opening a .doc, .xls, .ppt etc file except the temporary file C:\Users\xxxxxx\AppData\Local\Temp\sv6a8vhe.tmp\sv6a8vt4.tmp is not created. 
Many of the required files are hidden files ...

... so before you begin you must switch on being able to see hidden files by:

1 On W10 go Start > Settings > type folder options into the Search box > Enter > View tab. On W7 go Start > Control Panel > Folder Options > View ...

2 Select Show Hidden files, folders and drives

If you have not done this you will not be able to see the temporary files folder or the temporary files inside it. In Windows 10, go File Explorer > View (Ribbon tab) > Options ..., to open the Folder Options/File Explorer Options window.
You MUST switch on Show Hidden Files and Folders or you will not be able to see the temporary folder or the files inside it
You MUST switch on Show Hidden Files and Folders or you will not be able to see the temporary folder or the files inside it
First look for previous versions of the file itself

Say you have lost ...My documents\fred.odt (or fred.doc or fred.rtf etc). Before trying to get back temporary files, use Recuva to see if you can get back previous versions of ...My documents\fred.odt (or fred.doc or fred.rtf) by looking for deleted fred.odt (or deleted fred.doc or fred.rtf etc) in ...My Documents\ (or in whichever folder the file fred was located).

Did you have AutoRecovery set to ON?

Check if AutoRecovery was set to ON by Tools > Options > Load/Save > General ...

If AutoRecovery was ON, and you were editing fred.odt, look in C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\ for fred.odt_0.odt. This is the file as it was when it was last saved by AutoRecovery. You could also look for deleted versions. " xxxxxx " here and below is your username on your PC.

Did you have Create a Backup copy set to ON?

Check if Create a Backup copy was set to ON by Tools > Options > Load/Save > General ... When ON, Create a backup copy saves the last version of the file in \backup

If Create a backup copy was ON, and you were editing fred.odt or fred.doc, look in C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\ for fred.bak. Open fred.bak with Writer (or rename it to fred.odt). This is the file as it was when you opened it for editing.

No luck so far? It's time to look for temporary files.

Looking for temporary files

When you open a file for editing, Writer creates temporary files and it is these temporary files you need to look for. Writer deletes these temporary files when you close the document and/or when Writer closes properly. If Writer crashes, or your PC crashes, these files are often not deleted and can easily be recovered. If they have been deleted, you just need to un-delete them.

When you open an existing .odt file, Writer takes a copy of the .odt file as it was when opened and saves the copy of the .odt file as a temporary file with a name like sv2ju21c.tmp. This is the file you are trying to recover. You are therefore looking for files with names something like C:\Users\xxxxxx\AppData\Local\Temp\sv2ju1mk.tmp\sv2ju21c.tmp. Note that it is very unusual for a folder to be called C:\Users\xxxxxx\AppData\Local\Temp\sv2ju1mk.tmp, with a " . " in the folder name, but this is what Writer does.

When you get such a file just rename it to a .odt file and try to open it.

If you save a .odt file while you are editing it and continue to edit it, Writer updates the temporary file above to be the same as the newly saved file.

If you create a new document from scratch Writer creates an empty temporary file with nothing in it, so there is nothing to recover unless you had AutoRecovery set to ON and an AutoRecovery save had taken place.
Temporary files inside folder C:Users\John\App\Data\Local\Temp\sv3i2d1f.tmp<br /><br />The first file is the .odt file as it was when you opened it - this is the one you want<br />The second file is a binary file - ignore it - it is to do with displaying<br />The other files are copies of the images which have been paged out of memory.  You do not need them as all the images are in the first file. If you have added images then some may be here
Temporary files inside folder C:Users\John\App\Data\Local\Temp\sv3i2d1f.tmp

The first file is the .odt file as it was when you opened it - this is the one you want
The second file is a binary file - ignore it - it is to do with displaying
The other files are copies of the images which have been paged out of memory. You do not need them as all the images are in the first file. If you have added images then some may be here
The following is based on Windows 7 but other versions of Windows should be very similar.

Mac and Linux

If you are running Mac or Linux, it should be very similar. All you need to do is to check which paths Writer uses by Tools > Options (Preferences for Mac??) > OpenOffice > Paths .... If you are in doubt, open a .odt file (or create a new one or edit a .doc file - whatever it was you were doing when you lost the document) and check to see where the temporary files go and what they are called. Then search in that folder or folders for deleted temporary files for your lost document where the deleted files will have similarly formed names to those you found when doing the check. You will a need Mac or Linux unzip utility and a Mac or Linux un-delete utility.

USB memory stick or second disk

It is better (but not essential) to un-delete the file(s) to a different disk from the disk on which the original file was created or saved because, if you un-delete to the same disk, you run the risk overwriting the very files you are trying to get back! It is better, but not essential, to recover them to a USB memory stick, or to a second disk if you have one.

1. Looking for temporary files which are still there and have not been deleted

1a. If your PC or Writer crashed ...

... you may find that the temporary files are still there, so navigate to the Temp folder (it is specified in Tools > Options > OpenOffice > Paths ...) and see if you can see them. Sort the files in alphabetical order and rename the first file with a name like sv2ju1mk.tmp to fred.odt and try to open it with Writer.

If you cannot see any, then Writer has deleted them. You now need to un-delete them. Act quickly - they risk being overwritten the longer you leave it..

1b. Did you have AutoRecovery set to ON?

If you had AutoRecovery set to ON, then Writer should have automatically fixed your file for you. If Writer does not or cannot recover your file, follow the instructions below and check to see if the AutoRecovery files are still there. If there are no AutoRecovery files then look for deleted the AutoRecovery files. (Note - check to see if AutoRecovery was on by Tools > Options > Load/Save > General ...)

1c. Did you have Create a backup copy set to ON?

If you had Create a backup copy ... set to ON, look in the \backup folder for a file called fred.bak, where your file is fred.odt. Open fred.bak with Writer (or rename it to fred.odt). (Check to see Create a backup copy was ON by Tools > Options > Load/Save > General ...)

2. Looking for temporary files which have been deleted

If 1a, 1b and 1c failed you have to look for deleted temporary files. The method you use depends on what type of file you were editing, namely:

- whether it was an existing .odt file saved on your PC (or .docx file);
- a file which you had never previously saved; or
- a .doc, .xls, .ppt etc file.

From what I can gather, Writer handles .docx files in the same way as .odt files so, if you are recovering a .docx file, follow the instructions for .odt files.

2a. Recovering .ODT files which have previously been saved - also works for .DOCX files

In this case, you were editing a .odt file like fred.odt (or a .docx file like fred.docx).

You are looking for files with names something like C:\Users\xxxxxx\AppData\Local\Temp\sv2ju1mk.tmp\sv2ju21c.tmp. Note that it is very unusual for a folder to be called C:\Users\xxxxxx\AppData\Local\Temp\sv2ju1mk.tmp, with a " . " in the folder name, but this is what Writer does. You will therefore be looking for files called something like C:\Users\xxxxxx\AppData\Local\Temp\sv2ju1mk.tmp\sv2ju21c.tmp where "xxxxxx" here and below is your username.

Converting a found temporary file back to a .odt or .docx file

If you manage to find and undelete a file like ...sv2ju21c.tmp, you need to check if it is a .odt or .docx file as it could be a graphics file.

The easiest way to check if it is a .odt or a .docx file is to try to unzip the file. The easiest way to unzip it is to rename it to sv2ju21c.ZIP and double click it. If sv2ju21c.ZIP does not open a window showing files, it is a graphics file or a damaged file and it can be ignored.

If sv2ju21c.ZIP opens a window showing files then it must be a ZIP file.
- If one of the files is content.xml, the file is a .odt file, so rename the zip file back to sv2ju21c.ODT, and open it with Writer.
- If the window has a folder called \Word it is a .docx file, so rename the zip file back to sv2ju21c.DOCX, and open it with Writer.

You should get back the complete fred.odt (or fred.docx) file as it was the previous time it was saved and it should have all the images, both those already in the document when you opened it and all the images added since. You do not get any text added since the file was last saved.

If you had AutoRecovery set to ON then also see 3. Getting back AutoRecovery files when AutoRecovery has been set to ON below as you may also be able to recover some of the AutoRecovery files as well or instead.

3. Getting back AutoRecovery files when AutoRecovery has been set to ON

The following methods only work if you had AutoRecovery set to ON.

Note: you set AutoRecovery to ON by Tools > Options > Load/Save > General ... The Backup folder location is specified in Tools > Options > OpenOffice > Paths ..., and the default is C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\.

3a. Recovering the AutoRecovery file for an existing fred.ODT which was being edited - it should also work for fred.DOCX files

If you were editing fred.odt, then Writer creates an AutoRecovery file called fred.odt_0.odt in the Backup folder. The default backup folder is C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\ so you are looking for files named C:\Users\xxxxxx\App\Data\Roaming\OpenOffice\4\user\backup\fred.odt_0.odt where " 0 " is a zero.

First, navigate to the Backup folder and look for existing files like fred.odt_0.odt.

Second, if there are no fred.odt_0.odt files in the Backup folder, then use Recuva and try to find a deleted version of fred.odt_0.odt. If you do manage to find it, fred.odt_0.odt will have the entire contents of the document as saved at the AutoRecovery time it was created.

3b. Recovering the AutoRecovery file for a new document which has never been saved

If you are editing a new file and you have never saved it, Writer gives the file the name Untitled1.odt while you are editing it but does not save it. When Writer creates an AutoRecovery file, Writer creates a file called untitled_0.odt in the Backup folder as C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\untitled_0.odt where " 0 " is a zero.

First, navigate to the Backup folder and look for untitled_0.odt.

Second, if it is not there, then use Recuva and try to find a deleted version of the file. If you do manage to find it, it will have the entire contents of the document as saved at the AutoRecovery time it was created.

3c. .doc files. Finding the AutoRecovery file for an existing fred.DOC which was being edited

Assume you are editing fred.doc and you have AutoRecovery set to ON. When Writer does an AutoRecovery save, Writer creates a temporary AutoRecovery file for fred.doc called fred.doc_1.odt and saves it in the \backup folder. It could also be called fred.doc_0.odt or similar. The file will be named C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\fred.doc_1.odt. Writer deletes this AutoRecovery file when you save the .doc file you are editing and/or when you close Writer.
When you edit a .doc file AND you have AutoRecovery ON, Writer creates a copy of the file in the Backup folder
When you edit a .doc file AND you have AutoRecovery ON, Writer creates a copy of the file in the Backup folder
First, navigate to C:\Users\xxxxxx\AppData\Roaming\OpenOffice\4\user\backup\ and look for fred.doc_1.odt (or fred.doc_0.odt), where fred is the name of the file you were editing. If your PC or Writer crashed, you may be lucky and still find fred.doc_1.odt there.

Second, if you do not see fred.doc_1.odt, then use Recuva and look for deleted versions of it.

There are some more detailed explanations in the following posts which may be useful:

Using RECUVA to un-delete Writer .odt temporary files which are now deleted
Another on RECUVA

While I use the free Recuva, which runs under Windows, you can use any file recovery program. The free PhotoRec works under Windows, Linux and Mac OS.

These may also be helpful.

Using 7-ZIP
Inside an odt file
Hints on how to prevent it happening

Some hints ...

1 Do not be too hasty when shutting down your PC, or slamming the laptop lid shut, or pulling the USB memory stick out. AOO continues to write data to the file and to the profile for several seconds (many on a slow network) after the blue dotted line has finished crossing the screen. You must not shut down the PC or remove the USB stick while this writing is taking place.

2 If you save your file to a USB memory stick be sure to eject the USB memory stick safely. On Windows 7, right-click the USB icon in the System Tray (bottom right, by the time) and choose Eject.

3 Always set AutoRecovery to ON - this saves a copy of the file every few minutes while you are working on it - it protects you against things like power cuts, OS freezes, AOO hangs etc. Do so by Tools > Options > Load/Save > General ... See the Tutorial on images for a possible problem with AutoRecovery.

4 Always ?? set Create A Backup copy to ON - this keeps the previously saved version of the file fred.odt as fred.bak in the \backup folder. Do so by: Tools > Options > Load/Save > General ... The \backup folder location is shown by Tools > Options > OpenOffice > Paths ... You may need to switch on Show hidden files (Control Panel > Folder Options > View ...) to be able to see the folder and its contents. You have to manage the \backup folder yourself and delete old, no longer required files.

Why the ?? ? Because you should remember that highly_confidential.bak will still be in the \backup folder long after you have deleted highly_confidential.odt.

5 ... and, of course, always take a daily backup of all important files and store them somewhere safe. A cheap USB memory stick is infinitely better than nothing. In an emergency, or if you need a very quick backup, just email yourself a copy of the file.

Remember, it is not a case of "if my disk fails ..." or "if I lose my file". It is a case of what do I do "when my disk fails ..." and "when I lose my file ...". You can download free backup utilities which will back up your hard drive daily so that you will never lose more than 24 hours work - I have used Cobian from http://www.cobiansoft.com/index.htm for many years and have never lost a file despite having disk crashes and a lightning strike which destroyed both my PC and hard drive.

See the Timestamp Backup extension which is designed for LO but (2018) works with AOO. You have to invoke it manually and when you use it you manually save a time stamped version of the file a separate backup folder. You need to delete older versions in the backup folder yourself. You can automate running it by Tools > Customise > Events ...

AOO and LO have File > Versions ..., where previous versions of the file automatically get stored in the .odt file. You need to manage the multipl versions manually and, if your document is big, the .odt file grows very large. The large .odt file does not affect the speed of AOO or LO because AOO and LO open only one copy of the document.

6 See the thread [Hint] How did I fix my ODT file for a discussion and some examples of broken, corrupted and lost files.
Last edited by John_Ha on Mon Jul 04, 2022 10:59 pm, edited 70 times in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
raum
Posts: 1
Joined: Fri Jul 14, 2017 8:43 pm

Re: [Tutorial] How to find and un-delete Writer temporary fi

Post by raum »

Not sure if we werent meant to post replies here, BUT THANK YOU! this saved me days of work. Version of file was sitting there in the temp folder.
THANKS!
OpenOffice 3.1
marc.berthoud
Posts: 2
Joined: Sun Feb 18, 2018 8:21 pm

Re: [Tutorial] How to find and un-delete Writer temporary fi

Post by marc.berthoud »

Hello John_Ha, thank you for your instructions, saved me a week of work, SO HAPPY :bravo: :bravo: :bravo:
Apache OpenOffice 4.1.3. on W7
marc.berthoud
Posts: 2
Joined: Sun Feb 18, 2018 8:21 pm

Re: [Tutorial] How to find and un-delete Writer temporary fi

Post by marc.berthoud »

PS: Forgot to write, that the TEMP folder, where I found the autosaved file was in the ADMIN and not user index
ADMIN/APPDATA/LOCAL/TEMP/svr3sq9.tmp folder :?
Apache OpenOffice 4.1.3. on W7
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: [Tutorial] How to find and un-delete Writer temporary fi

Post by John_Ha »

marc.berthoud wrote:PS: Forgot to write, that the TEMP folder, where I found the autosaved file was in the ADMIN and not user index ADMIN/APPDATA/LOCAL/TEMP/svr3sq9.tmp folder :?
I think this is because you are logging on to your PC as username ADMIN.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
book2020worm
Posts: 11
Joined: Fri Mar 27, 2020 9:58 pm

Re: [Tutorial] How to find and un-delete AOO/LO temporary fi

Post by book2020worm »

Thanks so much for your help.
I managed to restore the previous auto recovery file as suggested which was two weeks ago and after my last major update so absolutely no problem at all.
Brilliant.
OpenOffice 4.1.7
rusty75
Posts: 1
Joined: Tue Mar 31, 2020 10:10 am

Re: [Tutorial] How to find and un-delete AOO/LO temporary fi

Post by rusty75 »

hi, also many years after, YOU HAVE SAVED ME!!! THANK YOU!!!

I created an account just to write you this message. ASfter all hope had faded, I went out of the door but started a Recuva session. Lo and behold, the file was actually found, and in perfect shape!!

many thanks

and stay safe in these horrible coronavirus times.
OpenOffice 3.1 on Windows Vista / NeoOffice 2.2.3 with MacOS 10.4 / OpenOffice 2.4 on Ubuntu 9.04
User avatar
RoryOF
Moderator
Posts: 34571
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: [Tutorial] How to find and un-delete AOO/LO temporary fi

Post by RoryOF »

Note the link to the Timestamp backup, which is near the end of John_Ha's posting. I give it again for convenience:

The timestamp backup creates dated/timed backups. This must be invoked separately as it does not replace the normal Save function.
https://extensions.libreoffice.org/exte ... amp-backup

This will also work with Open?Office as well as LibreOffice.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Why is my Writer file full of #####?

Post by John_Ha »

Go back to above ...

First, any .odt, .ods, .odp etc file which opens in Writer with the ASCII Filter Option pop-up and which displays ##### throughout is completely corrupted. There is no user data in it. It cannot be repaired. Not even fragments of user data can be recovered. In fact, in homage to John Cleese's parrot sketch ...

User: I wish you to look at this OpenOffice file wot I was editing not 'arf an hour ago with your fine program. Wot's wrong with it? It's full of ########.
Forum helper: I'll tell you what's wrong with it, my lad. It's dead, that's what's wrong with it!
User: No, no, it's uh,... it's 'ere. 'Ave a look at it.
Forum helper: Look, mate, I know a dead OpenOffice file when I see one, and I'm looking at one right now.
User: No, no it can't be dead, it's, it's 'ere! I need my work back! Remarkable file, they tell me, the OpenOffice file, isn't, it? Beee-yooo-teee-foool format!
Forum helper: The format don't enter into it, mate. It's stone dead.
User: No, no! It can't be. It's just a bit broke!
Forum helper: Look 'ere mate, it's not just a bit broke. It's passed on! This file is no more! It has ceased to be! All its data has expired and gone to meet its maker! It's a stiff! Bereft of life, it rests in peace! If you 'adn't sent it 'ere it'd be pushing up the daisies! It's metabolic processes are now 'istory! Its content is fried! It's kicked the bucket, it's shuffled off its mortal coil, run down the curtain and joined the choir invisible!! THIS IS AN EX-FILE!!
User: [Close to tears] So you can't fix it???
Forum helper: No. Sorry mate. Not a chance. Not even the slightest glimmer of a chance. It's as dead as a Norwegian blue parrot wot's got its feet nailed to a perch.


Secondly, no-one has yet identified the precise reason for how this corruption occurs. It is strongly suspected that files with ##### are created when the PC hangs, crashes, suffers a power cut, or is powered off before it has flushed its buffers to disk. AOO has successfully written the file to the buffer in memory, but the PC crash prevents the buffer contents being written to disk. There can be a delay of several seconds - I have seen five or more seconds reported - before the buffer starts to be written to disk.

Despite the file having a .odt or .ods or ,odp etc qualifier, a file full of #### is not a properly formed .od* ZIP file. Instead, it is a flat ASCII text file which is full of null characters. When such a file is opened by AOO/LO, it opens in Writer and the user is asked which ASCII Filter should be applied. This is because AOO/LO sees it is a flat ASCII text file and AOO/LO Writer needs to be told what characters to expect in the file.
ASCII Filter Options when opening a file full of ####
ASCII Filter Options when opening a file full of ####
It does not matter what you answer - when opened you see only ##### characters because AOO/LO Writer display null characters as #.
Report.odt opened with LO (above) and with HxD, a binary editor (below).
Report.odt opened with LO (above) and with HxD, a binary editor (below).
Report.odt below is such a file which is full of null characters. Note that it is only 2.75kB - the smallest properly formed .odt file is about 10kB.

It can happen to Writer, Calc, Impress and Draw files. There has been a report of a .doc file being created full of nulls. A .doc file is not a ZIP file, it is a MS Compound OLE file, but it seems to be the same cause.

Also be aware that AOO continues to write a file long after the green line has finished crossing the bottom of the screen. Don't be too hasty and slam the laptop lid shut, or shut down the PC, before the file has finished being written.
 Edit: I now believe that files full of nulls (which Writer displays as #####) occur when the PC hangs, crashes, suffers a power cut, or is powered off during the time the file is being written and consequently the buffer does not get flushed to disk so the file does not get written. AOO has correctly written the file to the buffer but there can be a delay of five seconds before the buffer is flushed to disk. If the PC crashes during this period, the file does not get written to disk and is lost.

Although I have been unable to cause it to occur by repeated testing it could also happen if the file is written to a USB memory stick and the stick is ejected before the file has been written, or if the PC crashes before the buffer is flushed. The default setting in W7 and later is for USB memory sticks not to use buffered writes so, unless the user has changed the setting, file are directly written to USB devices without being buffered. 
...
 Edit: I have now (2021) proved conclusively that AOO does not prevent Windows (or other OS) from shutting down a PC during the time AOO is actually writing a file to disk. This is being investigated by development - see Issue 126869 - Analysis Task: Lost/Corrupted Documents after Save/Shutdown - Comment 46. This does not cause the ##### problem but gives a separate problem where it truncates a .odt file and, typically, content.xml is missing or truncated. 

I have never seen LibreOffice do the "my file is full of ####" or "my file is truncated" problems so I think that LO may have fixed the bugs and it is now only AOO which does it.
Attachments
Report.odt
Report.odt is a corrupted file which is full of null characters.
(2.75 KiB) Downloaded 621 times
Last edited by John_Ha on Wed Jun 08, 2022 9:59 am, edited 41 times in total.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Michael A
Posts: 5
Joined: Thu Jun 11, 2020 8:51 pm

Re: [Tutorial] How to find and un-delete AOO/LO temporary fi

Post by Michael A »

Thank you, John. You're helping me find where the heck I am.
Michael A
OpenOffice 4.1.6 on Mac OS Catalina 10.15.5
rexwinn
Posts: 2
Joined: Sun Jul 05, 2020 12:34 am

Re: [Tutorial] How to find and un-delete AOO/LO temporary fi

Post by rexwinn »

Thanks. I can quit wondering. I don't have a backup for three months, and I know better. Appreciate knowing where I am. I probably turned off the PC too soon.
OpenOffice 4.1.7 on Windows 8
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

How do I know if my .od* file is truncated?

Post by John_Ha »

Go back to top

Say I have a file fred.odt (or .ods, .odp etc) which I suspect is truncated.

1. Look at the fred.odt file size - say it is 32 kBytes.

2. Open the .od* file with a ZIP utility (or rename fred.odt to fred.zip and double click it).

You should see something like below. Notice content.xml is reported as being 0 bytes which is bad news.
Clipboard01.png
3. Add up all the Packed Size values. In the file above it is about 10 kBytes.

4. Compare it with the actual file size on disk.

Here, fred.odt on disk is 32 kBytes but the ZIP says the sum of the packed files is only 10 kBytes. So, about 22 kBytes is present in the file but is not displayed in the ZIP report. In fact, content.xml has been truncated and there is some of content.xml present (about 22kB), but not the end of the file. Unfortunately, ZIP compression places the information necessary to unzip the file right at the end of the file so it too is missing and, without that data, the remnant of content.xml cannot be unzipped.

See [Tutorial] ODF repair tool] for instructions on using the utility.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
Post Reply