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

RE: st: Stata thinks files are read-only when they shouldn't be!

From   Roy Wada <>
To   <>
Subject   RE: st: Stata thinks files are read-only when they shouldn't be!
Date   Sun, 10 May 2009 18:03:16 -0700

> outreg2 lrwage lrwager firm_l firm_iqr [Self0 Self1 ...] 
> using myfile_`y', replace bdec(2) label nocons excel}
> file myfile_happ.txt is read-only; cannot be modified or erased
> dr(608)
> And I get this error whether myfile_happ.txt exists in the directory
> or not.
You usually get this error when the file is being used by another software,
usually Excel or Word. This happens when you peek at the output while 
-outreg2- is still running. This makes the file "read-only" to Stata.
The solution is to close the file and don't open it until Stata has 
finished running. Because Adrian's problem is intermittent, this might
be the case.
If you want to look at an -outreg2- file while it is still running, then
you should copy-and-paste the file (control-c, control-v), and then look 
at the duplicated file.
I think this is mentioned somewhere in the help file (not leave the file 
open), but a smart thing is for -outreg2- to send its own error message 
telling you to close the file.
If this cannot be done, then it needs to be put in the help file
Hotmail® has a new way to see what's up with your friends.
*   For searches and help try:

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