Announcement

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

  • snapshot save - where?

    snapshot save goes on to "saves [the snapshot] to disk and restores from disk copies of the data in memory" (from the PDF manual). Was wondering "where" that save to disk takes place? Background (albeit any discussion if this is sensible or not) is: if I have a file in memory that contains sensitive data such as patient names, I can do some data safety stuff by e.g. loading that *.dta file only from a secure source; when I close Stata, I am (pretty) sure no trace is left in file form anywhere outside the original secure source. When creating snapshots though, where do they get saved to? Are they "really" deleted on closing Stata...
    Cheers

  • #2
    This is a legitimate question, I think, and one on which the documentation holds no answer. One guess would be that the snapshot file is saved wherever -tempfiles- are saved, which would depend on your operating system. One way to investigate this is to save something to a tempfile, and then use -mac dir- to see where tempfiles are located on your system, so that you could -cd- to that folder and see if there's anything looks like your snapshot. If that doesn't help, I'd say Stata Tech Support would be the place to inquire.

    Comment


    • #3
      I can confirm that Mike Lacy's guess is exactly right on my system. Though tracking this down is slightly simpler -- after all, when you save any file and hence also a tempfile, you get a message saying where the file was saved, so you don't need to go check mac dir. For instance on my system (macOS Tahoe):

      Code:
      . tempfile a
      . save `a'
      file /var/folders/p_/bunchofrandomletters/T//S_bunchofnumbers.000001 saved as .dta format
      then when I saved a snapshot
      Code:
      . snapshot save
      snapshot 1 created at 5 Oct 2025 21:21
      a new file, SSbunchofnumbers.000001 immediately appeared in the same folder /var/folders/p_/bunchofrandomletters/T//

      Incidentally, changing the file name extension to .dta made the file easily openable as a standard Stata dataset.
      Last edited by Hemanshu Kumar; 05 Oct 2025, 10:06.

      Comment


      • #4
        Also, see c(tmpdir)

        Comment

        Working...
        X