Why do I get the Error using load. Unable to read file '<filename>'. No such file or directory when running compiled application?

조회 수: 7 (최근 30일)
I have a compiled application that has throws an error:
" Error using load
Unable to read file '<file:///C:/Users/tawong/AppData/Local/Temp/tawong/mcrCache9.1/HEARTs0/data_analysis/E2E0070.txt'. C:\Users\xyz\AppData\Local\Temp\tawong\mcrCache9.1\HEARTs0\data_analysis\E2E0070.txt'.> No such file or directory. "
I use deploytool --> application compiler to compile the application and add a folder "data_analysis" to the "Files required for your application to run". The program runs fine and accesses the files in the data_analysis folder most of the time but every once in awhile I receive the above error. I then have to add the .txt file to that temporary folder manually. Is there something I can do so that I don't have to add the text files to that temporary location? I would like the information contained in the file to remain protected from access and tampering and that's why I include it in the compiling.

채택된 답변

MathWorks Support Team
MathWorks Support Team 2019년 7월 19일
The default location for MCR cache directory is under a temp folder.
This might happen if some Windows program like Disk Cleanup is deleting files from Temp folder.
To fix this, change the location of MCR Cache Root by adding system environment variable-
MCR_CACHE_ROOT to some other location in directory.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by