I recently installed Dynare 7.2 as well as Matlab 2026b on a new laptop. I have Dynare installed in C:\dynare, and my working files in C:\dynare\work.
When I enter “dynare modfile,” I get the error
terminate called after throwing an instance of ‘std::filesystem::__cxx11::filesystem_error’
what(): filesystem error: cannot remove all: Access is denied [modfile/model/bytecode] [modfile/model/bytecode\block].
I know this can happen if files are in a cloud storage like OneDrive, but my files are on the local C: drive. I have tried restarting Matlab, but get the same result. I have the same setup with Dynare 6.2 and Matlab 2021b on my old laptop, and don’t have this problem. Any ideas? Thanks.
That message indicates that write access is blocked. It can happen for various reasons, e.g., the file being mirrored/synched by a cloud app like Dropbox or an antivirus program.
I think I’ve partly figured out the problem. Something goes wrong in the process of moving files from the old laptop to the new one and trying to rerun the .mod file. I can run the file on the new laptop as a new file with no other associated files or folders. The problem seems to occur if I try to reproduce previous results that load mh and mode files copied from the old laptop. I copied the entire folder with the name of the .mod file, but that didn’t seem to be enough. I have a lot of code on the old laptop that I’d like to be able to reproduce. Should copying all those files and the associated folders onto the new laptop allow me to rerun them, loading mh and mode files?
Specifically, I usually estimate a model in multiple steps, first finding the mode, and then loading the mode file and doing mh replications, then saving the replications and doing more if needed for convergence. Then I run it just loading the saved replications and doing things like impulse responses or variance decompositions. I’d like to be able to redo that last step on the new laptop. That’s what didn’t work at least for this one .mod file. Thanks.