任何方法有一个ActionScript 3(的Flex / AIR)项目打印到标准输出?有一个、标准、方法、项目

2023-09-09 21:34:05 作者:月亮邮递员

有没有办法让从ActionScript 3的项目打印的东西编译成二进制的标准输出的执行的时候?

Is there any way to have a binary compiled from an ActionScript 3 project print stuff to stdout when executed?

从我收集的,人们一直将解决此限制通过编写依赖于本地套接字连接和AIR应用程序,写入到本地文件系统文件的黑客,但这是pretty的太多了 - 这显然不可能的Flash Player和AIR运行时从Adobe。

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.

有任何项目(如基础上,狨code)正试图执行一些会提供这种功能?

Is there any project (e.g. based on the Tamarin code) that is attempting to implement something that would provide this kind of functionality?

推荐答案

通过AIR在Linux上,很容易写入stdout,因为这个过程可以看到自己的文件描述符在/ dev下的文件。

With AIR on Linux, it is easy to write to stdout, since the process can see its own file descriptors as files in /dev.

有关标准输出,打开的/ dev / FD / 1 的/ dev /标准输出的FileStream ,然后写了这一点。

For stdout, open /dev/fd/1 or /dev/stdout as a FileStream, then write to that.

例如:

var stdout : FileStream = new FileStream();
stdout.open(new File("/dev/fd/1"), FileMode.WRITE);
stdout.writeUTFBytes("test\n");
stdout.close();

注意:查看this回答之间的差额 writeUTF() writeUTFBytes()可 - 后者将避免混乱的输出标准输出。

Note: See this answer for the difference between writeUTF() and writeUTFBytes() - the latter will avoid garbled output on stdout.

 
精彩推荐
图片推荐