- Change the permissions of the files to read-only before packaging the .mltbx file. This can be done using the appropriate command in your operating system. For example, in Windows, you can use the "fileattrib" command to set the read-only attribute for the files.
- Modify the MATLAB code to use the "userpath" function to read and write files. This is a recommended workflow in both MATLAB Desktop and MATLAB Online, as it allows for dynamic reading and writing of files without encountering read-only file system errors.
- Include a check in your MATLAB code to validate the folder permissions. This can ensure that the folder where the files are installed is writable, and if not, create a new folder with the appropriate permissions.
Editability of Files Packaged into MATLAB Toolbox File (mltbx file)
9 ビュー (過去 30 日間)
古いコメントを表示
I need to deliver a MATLAB Toolbox File (extension .mltbx) for a customer. All the files have read / write / execute permissions (including the GettingStarted.mlx file) after the customer installs the mltbx file.
I want the files to be read only in order to protect the install from mistakes that the end user may make. It appears that even when I set the permissions to be read-only just prior to packaging up the .mltbx, the end result is that the files have read / write permissions.
How can I fix this?
Thanks.
0 件のコメント
回答 (1 件)
surya venu
2024 年 4 月 12 日
Hi,
To ensure that the files within the MATLAB Toolbox File (.mltbx) are read-only after installation, you can consider the following steps:
It is important to note that setting the files to read-only may not be sufficient to prevent modifications if the user has administrative privileges. Therefore, it is recommended to use a combination of these methods to ensure the integrity of the files within the .mltbx file.
Hope it helps.
0 件のコメント
参考
カテゴリ
Help Center および 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!