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 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Harimurali
Harimurali il 8 Mag 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 Commenti
Michael
Michael il 9 Mag 2024
Modificato: Michael il 9 Mag 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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Search Path in Help Center e File Exchange

Prodotti


Release

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by