Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to recover lost do files? How to open tempfiles in readable format?

    Hello,
    I have lost a do file that I have worked on for a whole month. I did not delete it but I cannot see it in the folder where it has been saved.
    Before, it has been sometimes failing to save new changes and I would save it as a new file. I have checked in each and every folder on my PC but I cannot trace it anymore. I have tried to use the tempfiles that I have found where the do file was saved but I have not been successful.

    Could anyone be knowing how to recover lost do files?

    How can I open the temfiles ? I have used the command: disp c(tmpdir) to allocate where the tempfiles are stored and then tried to open any of them by using the command doedit C:\windows\Temp/asw792eb2c755e6914d bu when I opened, in the do files I had a text that is not readable.

  • #2
    Bad news: I don't think there is any sense in which Stata backs up .do files. What is lost is between you and your operating system. Also, temporary files are intended to disappear by the end of a Stata session, at the latest. The only temporary files still visible are likely to be debris from Stata or your machine crashing and not much use.

    When I lose files it's usually dopeyness on my part in saving files in one place and not noticing where I was or forgetting where I had been. So learning how to find files with your operating system is crucial. In Stata under WIndows that means shelling out with

    Code:
    !
    changing to the root directory and searching for say


    Code:
    dir *.do /s
    -- although I would be pleased to learn of other, better methods and this won't find files that no longer exist.

    Comment


    • #3
      As ever, Nick gives great advice. I'll just add that, for finding files of all kinds, my go-to tool is "Everything" (for Windows only): https://www.voidtools.com/faq/. Freeware, very fast

      Comment

      Working...
      X