Hi there, I think Module.arguments is what you're looking for:
https://kripken.github.io/emscripten-site/docs/api_reference/module.html#affecting-execution HTH, Ariel On Monday, July 13, 2015 at 2:07:13 AM UTC+3, Bryan Duggan wrote: > > Hey > > I presume this is standard enough usage for emscripten, but I cant figure > out how to do it. I am trying to port a command line C program called > abc2midi to emscripten. > > Everything compiles fine and I can get both the javascript to generate and > run in node and the HTML to generate and run in the browser. > > Now I want to do the following: > > 1 Write a text file to the virtual file system. This is how Im doing it: > > var Module = { > 'print': function(text){ > console.log(text) > }, > 'printErr': function(text){ > console.log(text) > }, > 'preRun' : function(){ > console.log('prerun'); > //FS is not defined > FS.createDataFile("/", "in.abc", abcContents, true, true); }, > 'noInitialRun': true, > }; > > 2. Call the main method and pass in some command line arguments including > the file name. I cant find an example of how to do this and everything Ive > tried has not worked > > 3. Read back the generated file from the file system > > Surprisingly hard to find an example of this pretty straightforward > scenario! Any help would be much appreciated > > Bryan > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
