[Project_owners] Access to Terminal

joe ertaba belaviyo at gmail.com
Sun Jan 27 04:39:08 PST 2008


http://developer.mozilla.org/en/docs/Code_snippets:Running_applications

in windows I can put "c:\\windows\\cmd.exe" to run command prompt but what
about linux ? what is the terminal path :)

PS: did you see *new beta edition* of flashgot ? they only support wget &
terminal in new beta edition (not publish yet !)


On Jan 27, 2008 3:41 PM, Jesper Staun Hansen <jesper at selvet.dk> wrote:

> that was one tricky question. Used some time to find you an answer. This
> will probably be my best guess:
> http://developer.mozilla.org/en/docs/Code_snippets:Running_applications
>
> The way they run it is (look in components/flashgotService.js):
> runNative: function(args, blocking, exeFile) {
>    try {
>      if (typeof(exeFile)=="object"
>        || (exeFile = this.exeFile).exists()
>        || this.createExecutable()) {
>        const proc=CC['@mozilla.org/process/util;1'].createInstance(<http://mozilla.org/process/util;1%27%5D.createInstance%28>
>          CI.nsIProcess);
>        proc.init(exeFile);
>        this.log("Running " + exeFile.path + " " + args.join(" ") + " --
> " +(blocking ? "blocking" : "async") );
>        proc.run(blocking,args,args.length,{});
>        if (blocking && proc.exitValue != 0) {
>          this.log("Warning: native invocation of\n"
>            +exeFile.path
>            +"\nwith arguments <"
>            +args.join(" ")
>            +">\nreturned "+proc.exitValue);
>        }
>        return proc.exitValue;
>      } else {
>        this.log("Bad executable "+exeFile);
>      }
>    } catch(err) {
>      this.log("Error running native executable:\n" + exeFile.path +
>        " "+args.join(" ")+"\n"+err.message);
>    }
>    return 0xffffffff;
>  }
>
>
> joe ertaba wrote:
> > Hi,
> >
> > how can I access to *linux terminal* from "@mozilla.org/process/util;1
> > <http://mozilla.org/process/util;1>"
> >
> > I want to send some commands to terminal from my extension, some thing
> > like run wget to get files ,...
> >
> > PS: recently Flashgot runs Wget in terminal window
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Project_owners mailing list
> > Project_owners at mozdev.org
> > https://www.mozdev.org/mailman/listinfo/project_owners
> >
>
>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> https://www.mozdev.org/mailman/listinfo/project_owners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mozdev.org/pipermail/project_owners/attachments/20080127/ad8f5313/attachment.html 


More information about the Project_owners mailing list