Is there any way to have a binary compiled from an ActionScript 3 project print stuff to stdout when executed?
From what I’ve gathered, people have been going around this limitation by writing hacks that rely on local socket connections and AIR apps that write to files in the local filesystem, but that’s pretty much it — it’s obviously not possible with the Flash Player and AIR runtimes from Adobe.
Is there any project (e.g. based on the Tamarin code) that is attempting to implement something that would provide this kind of functionality?
With AIR on Linux, it is easy to write to stdout, since the process can see its own file descriptors as files in /dev.
For stdout, open
/dev/fd/1or/dev/stdoutas aFileStream, then write to that.Example:
Note: See this answer for the difference between
writeUTF()andwriteUTFBytes()– the latter will avoid garbled output on stdout.