Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: [Stata 9] Convincing Stata to let me quit the program withoutconfirmation


From   James Muller <james.muller@internode.on.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: [Stata 9] Convincing Stata to let me quit the program withoutconfirmation
Date   Sat, 27 Aug 2005 23:43:56 +1000

An example daemon mode for Stata in the form of an ado file:

To use this starting Stata type
> stata daemon_mode /path/to/file.do
or whatever works for your OS.

Stata will simply loop until the file /path/to/file.do exists, then will delete the file. I might make this a proper package, though it's dead simple. Anyone want any more functionality?

Anyway, here's the ado file:


--------------------daemon_mode.ado----------------------------
program define daemon_mode
args path

while (1) {
sleep 1000

capture file open FH using "`path'", read
if (_rc == 0) {
file close FH
do "`path'"
erase "`path'"
}
}

end
---------------------------------------------------------------------------




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