Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: controlling tempfile names, avoiding conflict between concurrent Stata instances


From   László Sándor <sandorl@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: controlling tempfile names, avoiding conflict between concurrent Stata instances
Date   Sun, 1 Sep 2013 23:25:23 -0400

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/

*
*   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index