Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Markstat - 3621 attempt to write read-only file

    Hi,

    I'm trying to export in html my .stmd file using markstat by German Rodriguez but it keeps returning the error 3621 attempt to write read-only file. I am running the newest version of markstat and have actually exported successfully but for some reason, making changes in the .stmd file stops me from successfully exporting. That being said, that doesn't allow for a workaround as I need those changes to the .stmd file for the content I want in my html file.

    Here is a simple version of code in my stmd file that produces the error:
    Code:
    % Madagascar 2019 Read-Me File
    % Nicolas Perreault
    % 13 June 2021
    
    
    
    **BACKGROUND**\
    This Read-Me file will explain every do file necessary to first generate our cleaned 2019 ///
    data and then generate our cleaned 3-wave panel data. Most variables are only compatible ///
    between 2012 and 2019 which means values were left missing for those variables in 2004. ///
    The order of this Read-Me file is respective to the order the do files must be run. ///
    The importance of respecting the order for running them being with respect to their variable ///
    interdependancies. Not doing so will prevent the do files from running or worst, lead to ///
    inconspicuous variable errors.
    
    **Do Files**\
    
    
    ## 1. Introduction


    And here is the do file code for markstat:
    Code:
    clear all
    set more off
    capture log off
    capture ssc install markstat
    capture ssc install whereis
    
    whereis pandoc "C:\Program Files\Pandoc\pandoc.exe"
    
    cd "${cdir}\do"
    
    
    markstat using Nicolas_readme
    Any help would be appreciated. Thanks!
    Last edited by Nicolas Perreault; 17 Jun 2021, 08:40.

  • #2
    Hi Nicolas Perreault. The stmd code you posted above works fine in my system. Note that when you are writing the narrative you do not need the continuation comments ////. In fact you should omit them, as they would come in the middle of your text, as seen below. As for the error, I would make sure the html file is not open in Word or similar software that puts a lock on it.

    Click image for larger version

Name:	perreault.png
Views:	1
Size:	27.1 KB
ID:	1615138

    Comment


    • #3
      Hi German Rodriguez, thanks very much for your quick response. For the continuation comments, I actually only put them in this STATALIST post so that it was well formatted here. So they are omitted in my code but thanks for taking the time to comment on that. Your response is very insightful because it got me thinking and I figured out the issue. It seems that Dropbox isn't compatible with this command. At least, most of the time it will be stubborn and not let this command save its output. I changed the directory to my desktop and it now works perfectly.

      I saw elsewhere that when saving files within loops on Dropbox, STATA will also do this error. The solution seemed to be about inserting sufficient pause times between the loops so that Dropbox doesn't deny file saving. With markstat, there is no where to put a pause that would solve this issue. Note that I also tried deleting the previous files in case the issue was about replacing existing saved files. That solution came to no avail. If I may humbly suggest, perhaps a future update of markstat would be to make it more compatible with saving on servers like Dropbox.

      Comment

      Working...
      X