有没有办法让 AIR 1.5 应用程序从 stdin 读取并写入 stdout/stderr?
一直在研究Adobe AIR 1.5的文件系统相关类,但到目前为止我还没有看到任何提到如何与stdin/stdout/stderr交互的内容。 有点令人惊讶,因为 AIR 使得能够以其他方式与本地文件系统交互,并且有一个 FileStream 类。
我想要从父进程启动 AIR 应用程序,然后通过 stdin/stdout 通过异步 I/O 与 AIR 应用程序交互。 将避免需要使用本地主机上的端口并进行套接字 I/O。 (是的,这是关于以跨平台方式桥接 java 和 AIR 的 Merapi 风格。)
Have been studying the file system related classes of Adobe AIR 1.5, but so far I've not seen anything that mentions how to interact with stdin/stdout/stderr. Is a bit surprising as AIR makes it possible to otherwise interact with the local file system, and there is a FileStream class.
Am wanting to launch an AIR app from a parent process and then interact with the AIR app via async i/o via stdin/stdout. Would avoid needing to use port on localhost and doing socket i/o. (Yeah, this about bridging java and AIR in cross platform manner ala Merapi style.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这是不可能的 - 你必须使用套接字。 如果您使用的是 Windows,您可以检查 http://www.northcode.com/ 之类的内容是否支持您为了达成这个。
I don't think this is possible - you will have to use sockets. If you are on windows you could check if something like http://www.northcode.com/ enables you to achieve this.
事实上,我研究了 AIR 1.5 文档,看起来他们省略了对 stdin、stdout、stderr 文件管道的任何访问 - 尽管它们在 AIR 支持的所有平台上都可用。
我认为 GUI 应用程序不需要费心处理通常与命令行程序相关的事情。 然而,对于父进程与子进程进行双向通信,这样的管道完全没问题(我已经编写了大量以这种方式工作的 perl 多处理程序)。
通过 stdin、stdout、stderr 的进程间管道实现的 Merapi 桥库将向 AIR 授予一定程度的 Microsoft PowerShell 功能(可以通过 std 进程间管道封送 .NET 对象)。
Indeed, I have researched the AIR 1.5 documentation and looks like they have omitted any access to stdin, stdout, stderr file pipes - despite they are available on all the platforms that AIR supports.
I suppose the thinking is that a GUI app doesn't need to bother with something that is usually associated with command line programs. However, for a parent process to communicate bi-directionally with a child process, such pipes would be entirely fine (I've written plenty of perl multi-processing programs that work this way).
The Merapi bridge library implemented via the interprocess pipes of stdin, stdout, stderr would grant to AIR a shade of Microsoft PowerShell ability (which can marshal .NET objects over std interprocess pipes).