plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

DedicatedDev avatar image
DedicatedDev asked EPellissier answered

Reading and Writing Files on Xbox (possible with WASM?)

Hi,

I have some coding experience but I haven't used WASM or coded for Xbox before. I'm interested in what's possible with regards to reading and writing to files on XBox. Am I right in thinking that you can only write values (e.g. SimVars) collected at runtime to a file within the WASM sandbox and can't read from a preloaded database either? E.g. on PC I could write a DLL that reads and writes from/to a DB that I ship with the product but I can't do this on Xbox, correct?


Thanks for any clarification.


wasmWASMXbox
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

1 Answer

·
EPellissier avatar image
EPellissier answered

Hi @DedicatedDev,

Be it on PC or Xbox, you cannot write to files distributed within your package - however you can copy them to the "work" (sandbox) folder upon first launch and then read/write to the copied file (many add-ons work like this).

As for using a DB, I suppose it all depends on what you want to use: would it be some kind of custom DB you wrote yourself or are you planning to use a more common kind of DB? If the latter, you must ensure that either you have access to the source code and it compiles fine to WASM (by including the appropriate files to your project), or that a static WASM lib is available to be linked with your project. We haven't tried it ourselves but I suspect SQLite would be a good candidate for that kind of things.

Please let us know if you need more information on this topic.

Best regards,

Eric / Asobo

10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.