Matlab Compiler: Is "userpath" always there and accessible?

28 views (last 30 days)
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 Comments
William Thielicke
William Thielicke on 27 Nov 2024 at 15:15
Thanks, I think this is safe enough for me. If someone really wants to break my tool by changing permissions or deleting folders, then he still can, and that is ok. I can still display an appropriate messagebox in this case.
Good point with the userpath reset, I'll add an
if isdeployed;userpath("reset");end
William Thielicke
William Thielicke on 27 Nov 2024 at 15:21
...well, userpath reset doesn't work with compiler unfortunately.

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 27 Nov 2024 at 15:48
I would probably try using the tempdir and/or tempname functions.
  1 Comment
William Thielicke
William Thielicke 1 minute ago
But tempdir doesn't always return a path, right? I have the feeling that userpath might be better, because this directory is apparently always created by Matlab Compiler.

Sign in to comment.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!