Error writing to file (ostream::write operation failed)
2 views (last 30 days)
Show older comments
I have trained a VGG16 model and integrated it as a function block in Simulink. I want to use it for the classification of images. I want to use this model to create an application with code generation that will run on a Raspberry Pi. I also use the HW support package for the RasPi. Unfortunately, I get the following output in the diagnostic window:
Error:Error: File: C:\Program Files\MATLAB\R2023b\rtw\c\tlc\mw\codetemplatelib.tlc Line: 795 Column: 45
Error writing to file (ostream::write operation failed)
4 Comments
Andrea Amorosi
on 11 Mar 2025
I'm facing the same issue while trying to create FMU from a big simulink model.
The error is
Main program:
==> [00] C:\Program Files\MATLAB\R2024b\rtw\c\tlc\mw\codetemplatelib.tlc:LibWriteFileSectionToDisk(758)
[01] C:\Program Files\MATLAB\R2024b\rtw\c\tlc\mw\rtw_code.tlc:<NONE>(33)
[02] C:\Program Files\MATLAB\R2024b\rtw\c\tlc\mw\formatwide.tlc:<NONE>(853)
Error: File: C:\Program Files\MATLAB\R2024b\rtw\c\tlc\mw\codetemplatelib.tlc Line: 758 Column: 45
Error writing to file (ostream::write operation failed)
Should I make the C:\Program Files\MATLAB\R2024b\rtw\c\tlc\mw\ folder user writable?
Les Beckham
on 11 Mar 2025
No you should not. You should change whatever process you are doing so that it is not trying to write into C:\Program Files\Matlab\....
Answers (0)
See Also
Categories
Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!