4

I'm trying to use XULRunner to add a GUI to a command line based program.

One solution would be to use something like popen from the XUL application to interact with the command line program.

My questions:

  • Does XPCOM have popen?
  • Does XPCOM have enough primitives to create popen?
  • Is there another approach that gives access to the standard in/out of a process?

PyXPCOM appears to have this capability, but I'd rather not add a dependency if possible.

Syed mohamed aladeen
  • 6,507
  • 4
  • 32
  • 59
ctuffli
  • 3,559
  • 4
  • 31
  • 43

1 Answers1

0

[edit] It's possible to implement using js-ctypes and in fact someone already did that.

The module is called subprocess.jsm, here's the documentation: http://hg.mozilla.org/ipccode/file/tip/readme.txt

(The 2009 version of the answer: not in pure JS, no. It's possible to create a binary XPCOM component and in fact someone did that - see https://bugzilla.mozilla.org/show_bug.cgi?id=68702.)

Nickolay
  • 31,095
  • 13
  • 107
  • 185