Hi Stata Users,
I'm having a problem running a do file. It has a section of code for each of 12 months and there are about 4-5 save statements for each month. I was hoping to just run the program as I normally do in its entirety. However, I keep getting the error message "file XXXXXX cannot be modified or erased; likely cause is read-only directory or file". If I highlight the single "save" command line and run it again, it works.
I noticed that there is a April 2016 post from Steen Harsten on here which suggests adding a sleep command. I've done this after each save, but not sure it's helping. Initially I thought it might be as it got to the last save in February, but then I highlighted that code (to do the final save in February) and the remaining program and whilst it then did the last save in February, it didn't work for the first save in March.
The biggest file I've got saving is around 4mb so pretty small files! I've recently got a much more powerful laptop and one of the comments on the April 2016 posts states that this can be a problem with large files (which can be rule out here) or with powerful machines where saving to hard drives is slow so I imagine it falls into the second category if this is the same problem. I added "sleep 2000" after each save which is 2 seconds, but don't want to increase it too much more. I also hope that this doesn't become a problem with all the other do files I've got either. I work in an organisation where we don't have admin rights etc and there is a lot of firewalls. I'm using Stata 15, but never updated it with any updates due to firewalls so it is the original version as released.
I've had this problem intermittently with my old laptop prior to getting a much more powerful one, but now it's hardly running any of the program as it's stopping so much.
Any other ideas to solve this would be appreciated.
Thank you.
Mandy
I'm having a problem running a do file. It has a section of code for each of 12 months and there are about 4-5 save statements for each month. I was hoping to just run the program as I normally do in its entirety. However, I keep getting the error message "file XXXXXX cannot be modified or erased; likely cause is read-only directory or file". If I highlight the single "save" command line and run it again, it works.
I noticed that there is a April 2016 post from Steen Harsten on here which suggests adding a sleep command. I've done this after each save, but not sure it's helping. Initially I thought it might be as it got to the last save in February, but then I highlighted that code (to do the final save in February) and the remaining program and whilst it then did the last save in February, it didn't work for the first save in March.
The biggest file I've got saving is around 4mb so pretty small files! I've recently got a much more powerful laptop and one of the comments on the April 2016 posts states that this can be a problem with large files (which can be rule out here) or with powerful machines where saving to hard drives is slow so I imagine it falls into the second category if this is the same problem. I added "sleep 2000" after each save which is 2 seconds, but don't want to increase it too much more. I also hope that this doesn't become a problem with all the other do files I've got either. I work in an organisation where we don't have admin rights etc and there is a lot of firewalls. I'm using Stata 15, but never updated it with any updates due to firewalls so it is the original version as released.
I've had this problem intermittently with my old laptop prior to getting a much more powerful one, but now it's hardly running any of the program as it's stopping so much.
Any other ideas to solve this would be appreciated.
Thank you.
Mandy
Comment