Every time I start matlab it puts two new docsearch_XXXX.log" files into my c:\temp folder. How can I change the folder it uses?

2 vues (au cours des 30 derniers jours)
Every time I start matlab it puts two new files into my c:\temp folder. One called docsearch_process_nnnnn.log and one called docsearch_http-nnnnn.log".
These cannot be deleted and get in the way of my script output files.
How can I change the folder it uses for these files?
Each new release of Matlab since 2022a (mayber earlier) has been doing this.

Réponse acceptée

Harimurali
Harimurali le 8 Mai 2024
Hi Michael,
The "docsearch_process_nnnnn" and "docsearch_http-nnnnn" LOG files are generated by MATLAB's documentation search feature. These LOG files are generated each time you start MATLAB and use the documentation search.
To change the folder MATLAB uses for these LOG files, you can set the "TMP" environment variable in your Windows operating system to point to a different directory. MATLAB uses these environment variables to determine where to place temporary files, including these LOG files.
Follow the given steps to change the "TMP" environment variable in Windows using the "setenv" function and startup script in MATLAB:
  • Open the "startup" MATLAB script file in your "userpath" folder:
setenv('TMP','new/temp/folder/path');
  • Save the script and restart MATLAB. Type "tempdir" in the MATLAB command window and you can see that the temporary directory where MATLAB saves the LOG files have changed.
  • You can also change the "TMP" environment to any other folder of your preference by using the "setenv" function.
Refer to the following documentation for more information on the "setenv" function: https://www.mathworks.com/help/releases/R2023b/matlab/ref/setenv.html?s_tid=doc_ta
Hope this helps!
  2 commentaires
Michael
Michael le 9 Mai 2024
Modifié(e) : Michael le 9 Mai 2024
It was actually TMPDIR. There are a bunch of them. In the end I did this in my startup.m:
up=getenv('USERPROFILE');
newTemp=[up filesep 'APPDATA' filesep 'Local' filesep 'Temp'];
setenv('TEMP',newTemp)
setenv('TMP',newTemp)
setenv('TMPDIR',newTemp)
setenv('TEMPDIR',newTemp)
But thanks for the pointer

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Search Path dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by