Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Austin Nichols <austinnichols@gmail.com> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | Re: st: controlling tempfile names, avoiding conflict between concurrent Stata instances |
Date | Tue, 3 Sep 2013 11:31:57 -0400 |
László Sándor <sandorl@gmail.com>: Can you create a new folder in your temp directory for each new instance of Stata, then change the temp directory to that (temporary) folder? On Sun, Sep 1, 2013 at 11:25 PM, László Sándor <sandorl@gmail.com> wrote: > FWIW, I cannot change STATATMP for my batches on the server, so I hope > the loop below can save me with tempfiles my own code opens. I am not > sure if built-in uses of temp files might still be prone to the error > of another Stata instance using a file with the same name already. > > tempfile test > cap confirm new file `test' > while _rc { > di "test existed already" > tempfile test > cap confirm new file `test' > } > > On Sun, Sep 1, 2013 at 1:54 PM, László Sándor <sandorl@gmail.com> wrote: >> Hi, >> I think I have a conflict of file use between multiple Stata instances >> on my server trying to write to the same tempfile name by coincidence. >> Is there a simple way to make sure I can avoid this? >> >> To be clear, I have very similar code that used tempfiles intensively, >> and my code crashed with an error of a "ST_ah000001.tmp not being able >> to be modified or erased (likely cause: read-only)." >> >> This is under Stata 12.1 for Windows. >> >> Thanks, >> >> Laszlo * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/