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: Post-program tempfiles or a temp directory?
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: Post-program tempfiles or a temp directory?
Date
Thu, 27 Sep 2012 19:37:37 +0100
I have not tried it but I imagine that temporary files opened in an
interactive session will remain open during that session. The
interactive session itself counts in Stata as a program in the widest
sense, at least for some purposes. You would then just need to pass
their names to your individual programs.
For further and better advice, you might need to spell out what your OS is.
Nick
On Thu, Sep 27, 2012 at 7:18 PM, James Sams <[email protected]> wrote:
> Short version: I want to create a -tempdir- that behaves like -tempfile-, only
> for directories.
>
> I'm trying to write a program that will create lots of tempfiles that will not
> be deleted after the end of the program but will be deleted after the end of a
> stata session. The purpose of this is to work with very large data in smaller
> logical chunks in a convenient manner.
>
> There does not seem to be any kind of flag to -tempfile- that will tell it to
> not be deleted after the end of the program run, though such a flag would be
> convenient.
>
> Similarly, I tried setting up the program to take a temporary directory
> (created by tempfile actually_a_dir ; mkdir `actually_a_dir') and then pass the
> `actually_a_dir' to my program, have it create the files there, hoping that the
> directory would be cleaned up like a tempfile would be. However, this is not
> the case. The directory is not even cleaned on stata's exit.
>
> If I can't manipulate tempfile to create files that will last longer, I want to
> create -tempdir- that will create a hook similar to Stata's tempfile to clean
> up the directory on the exit of the current context, or whatever exactly
> tempfile's rule is.
*
* 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/