フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

R2015b Compiled App preferences being lost

1 回表示 (過去 30 日間)
Dave Watson
Dave Watson 2020 年 7 月 22 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have an app compiled under R2015b and every once in a while - days to weeks - the preferences seem to be lost and must be reinitialized. Anyone have an idea why that might be? Thanks

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 7 月 22 日
Applications built with MATLAB Compiler create encrypted archives. When you run the application the first time, the archive is expected (but not decrypted) into a temporary directory. If the executable saves files without using an absolute path, then the files are saved inside the temporary directory.
When you run a second time, the program looks for the temporary directory and uses it if it is found -- and so has access to any files that were saved on earlier runs in the directory.
However, as it is a temporary directory, system administration tasks such as Windows Maintenance might decide to remove the directory... and in so doing, removes any files that had been saved (when absolute paths were not given.)
If you have anything non-temporary to save, then you should be saving using an absolute path. This might involve looking at environment variables to figure out where the user's home data directory is.
  1 件のコメント
Dave Watson
Dave Watson 2020 年 7 月 22 日
編集済み: Dave Watson 2020 年 7 月 23 日
Yes, thanks, that is fine but I am talking specifically about preferences using setpref/getpref. These are also stored in the cache in user Temp folder but I'd expect they would be saved session-to-session. Such is, apparently not the case. In the case I have to deal with, no one is aware any purging of the Temp folder is happening.

この質問は閉じられています。

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by