Statalist The Stata Listserver

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

Re: st: Editing DO files while it is being executed

From   Dave Ewart <>
Subject   Re: st: Editing DO files while it is being executed
Date   Mon, 3 Jul 2006 09:40:13 +0100

Hash: SHA1

On Friday, 23.06.2006 at 12:08 +0100, Dave Ewart wrote:

> Something one of our staff noticed is that 'strange things' can happen
> if one edits a running DO file.  For example:
> 1. Start a Stata job with "do";
> 2. While the job is still running, edit in an editor, say,
> by adding some additional commands to the end of it;
> 3. See the Stata job *execute those additional commands*, rather than
> executing the contents of the DO file as it was when the job started!
> This behaviour happens on both Stata versions we have here: Stata 8
> for Windows and Stata 9 for Linux.
> I used 'strace' to see what Stata was actually doing.  It appears that
> Stata reads the DO file in 512-byte blocks and only reads the next
> block when it needs to (and "when it needs to" can be minutes, hours
> or even days later).  Each new block read involves reading the file in
> its current state, which means that any editing of the DO file while
> the job is running can cause problems with the running job.
> The workaround is simple of course, one just avoids editing DO files
> which relate to running jobs.
> This behaviour of Stata seems strange: why doesn't it read the whole
> DO file at the start (which will only happen if the whole DO file is
> <512 bytes in size)?
> Any other comments?

Just thought I'd 'bump' this message again: I take it no-one else has
seen this behaviour, or at least no-one has seen it who is *worried*
about it?

- -- 
Dave Ewart
Computing Manager, Cancer Epidemiology Unit
Cancer Research UK / Oxford University
PGP: CC70 1883 BD92 E665 B840 118B 6E94 2CFD 694D E370
Get key from
N 51.7518, W 1.2016
Version: GnuPG v1.4.2.2 (GNU/Linux)

*   For searches and help try:

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