Matlab Compiler: Is "userpath" always there and accessible?
古いコメントを表示
Dear all,
my compiled app needs to store some temporary files in the background. Is it safe to assume that the directory given by userpath will exist on all computers? And that we will always have write access to this folder?
Thanks!!
William
3 件のコメント
Stephen23
2024 年 11 月 27 日
Although MATLAB creates this folder on startup/userpath-reset there is nothing stopping a user from deleting that folder or changing its permissions.
Calling USERPATH RESET immediately before you need to use it might be sufficient to ensure that it exists. But there is not much you can do about the permissions: fundamentally folder permissions are something the OS controls, not MATLAB.
William Thielicke
2024 年 11 月 27 日
William Thielicke
2024 年 11 月 27 日
回答 (1 件)
Steven Lord
2024 年 11 月 27 日
0 投票
2 件のコメント
William Thielicke
2024 年 11 月 30 日
Steven Lord
2024 年 11 月 30 日
It ought to return a folder name, unless perhaps a user has done something unusual with certain environmental variables. The documentation says that the folder is not guaranteed to exist, but you can check that with exist and use mkdir to create the directory if it does not exist yet.
カテゴリ
ヘルプ センター および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!