Permission error for PREFDIR when running a stand-alone application on a different system
Mostra commenti meno recenti
Hi!
I am trying to run a stand-alone application compiled on Linux on another Linux system. However, I am running into issues because it seems like at some point the Matlab preference folder is being accessed. However, since this folder does not exist on this system, it returns an error. I am now wondering why prefdir is included in the compiled version and how I can circumvent the stand-alone application to rely on it.
Error:
Unable to access preferences folder /home/[USERNAME]/.matlab/R2022a. Preferences folder must be writable.
Thank you!
4 Commenti
Walter Roberson
il 9 Mar 2023
Does your code call setpref() or savepath() or the image processing toolbox options function? (sympref would also be a concern except it cannot be compiled)
Walter Roberson
il 10 Mar 2023
Risposte (2)
Jan
il 9 Mar 2023
0 voti
If the preferences folder is hardcoded, such problems occur. Search in the code for the name of the folder an replace it by the command prefdir.
7 Commenti
Clara
il 9 Mar 2023
Jan
il 9 Mar 2023
Another idea is to insert some code tocreate the preferences folder on demand:
pref = prefdir();
if ~isfolder(pref)
mkdir(pref);
end
Clara
il 10 Mar 2023
Jan
il 10 Mar 2023
savepath should not occur in a compiled application.
Clara
il 10 Mar 2023
Walter Roberson
il 10 Mar 2023
I don't think so. addpath should only affect memory.
Clara
il 10 Mar 2023
Categorie
Scopri di più su MATLAB Compiler in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!