Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: tempfile already exists


From   "Sergiy Radyakin" <serjradyakin@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: tempfile already exists
Date   Wed, 29 Aug 2007 11:33:12 -0400

Hello Statalisters,

does anyone have the precise algorithm how the -tempfile- command in
Stata works? I have read the manual and this tempfile FAQ:
http://www.stata.com/statalist/archive/2004-01/msg00542.html

The manual says: "tempfile assigns names to the specified local macro
names that may be used as names for temporary files."

Can anyone confirm that Stata does or does nothing to check if the
1) temp candidate file already exists
2) temp candidate file is open by Stata or another application (Stata
or not Stata)
3) temp folder is writable
4) another Stata session is attempting to allocate tempfiles too
(syncronization to avoid overlaps)

If Stata does check these things, what might be an explanation for the
following:

tempfile tfile
save `"`tfile'"'
file c:\Documents and Settings\mylogin\Local
Settings\Temp\ST_010000jf.tmp already exists
r(602);

The situation occurs not always, but with a non-zero probability.
(Stata 9.2 up-to-date, Windows XP). The temp folder indeed contains
dozens of abandoned temporary files, but please do not just suggest to
clean it up regularly.

So far I have to enforce ",replace" everywhere in the program. This
doesn't seem to be a good idea, but the only straightforward choice.

Thank you,
   Sergiy Radyakin
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index