• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

MSFS20 WASM I/O error

Messages
162
Country
italy
despite is written in SDK:
Code:
In order to access files from within an add-on, filenames can be prefixed in two ways:
".\": to access the files from within the add-on package. This has a read-only access.
"\work": to access a persistent storage that the add-on can use. This is a read/write access.
this piece of code:
Code:
FILE* fh = fopen (".\\default.ln3", "r");

  if (fh == (FILE*) 0) {
      fprintf(stderr,
          "SIM SKUNK WORKS G-91 DEBUG: failed to open .ln3 file errno:%d\n", errno);
      perror("fopen() failed");
      return (char*)0;
  }
produces a I/O error (errno = 29)
Code:
from sim console:
SIM SKUNK WORKS G-91 DEBUG: SimConnect connection open: OK
SIM SKUNK WORKS G-91 DEBUG: failed to open .ln3 file errno:29
fopen() failed : I/O error
error 29 is reported as: ESPIPE not valid search
any clue ?
thanks in advance
Mario
 
Last edited:
Error 29 is an invalid seek.
thanks,
i don't see any reason for the invalid seek, the file does exists and is also in layout.json then should be set into VFS..
BTW:
i wrote on MSFS Forums, the answer was to read SDK :-)
Holy crap :-(
 
If the file is in your top level package folder try just a single backslash, or no dot backslash

fh = fopen (".\default.ln3", "r");

fh = fopen ("default.ln3", "r");
 
Last edited:
Both FILE* fh = fopen(".\\default.ln3", "r"); and FILE* fh = fopen("./default.ln3", "r"); works without errors with your code, Mario.

Are you really sure, that file default.ln3 exists inside add-on package directory? Not directory where wasm module resides.
I have tested your code inside GaugeAircraft example from SDK. That example already loads fonts, images files from Data folder. And data folder have copied to package folder and have path to load (example for fonts) nvgCreateFont(nvgctx, "serif", "./data/Roboto-Regular.ttf");
File default.ln3 was placed inside add-on package directory C:\MSFS SDK\Samples\GaugeAircraft\Packages\mycompany-aircraft-wasm-gauge
Screenshot 2020-12-18 020755.png
 
Thanks a lo
Both FILE* fh = fopen(".\\default.ln3", "r"); and FILE* fh = fopen("./default.ln3", "r"); works without errors with your code, Mario.

Are you really sure, that file default.ln3 exists inside add-on package directory? Not directory where wasm module resides.
I have tested your code inside GaugeAircraft example from SDK. That example already loads fonts, images files from Data folder. And data folder have copied to package folder and have path to load (example for fonts) nvgCreateFont(nvgctx, "serif", "./data/Roboto-Regular.ttf");
File default.ln3 was placed inside add-on package directory C:\MSFS SDK\Samples\GaugeAircraft\Packages\mycompany-aircraft-wasm-gauge
View attachment 66359
Thanks lot,
guess you are damned right, i set the file inside SimObiects/Airplanes/myplane that's was not SDK intention..
i should have noted that sample aircraft could access to Data :-(
cheers
Mario
 
Back
Top