nekovm hidden Processes

classic Classic list List threaded Threaded
10 messages Options
obi
Reply | Threaded
Open this post in threaded view
|

nekovm hidden Processes

obi
Hi,
I've been working for several weeks with haxe (especially targeting neko).
So I build up one little neko web app which runs under mod_neko (my
current machine is windows based).

It is very simple one and has only one main method:
        public static function main():Void
        {
                var args:Array<String> = neko.Web.getParamsString().split("&");
                var prc:Process = new Process(args.shift(), args);
                trace(prc.exitCode());
        }

If I compile it to neko byte code & try to invoke it via mod_neko like
this for example:
http://localhost/TestExec.n?haxe

It executes 'haxe.exe', but one console window get poped up during its
execution.
So my question is there any possible way to run hidden processes via
haxe/nekovm where their window  is not shown.

PS. tried with neko.Sys.command , which acts the same.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: nekovm hidden Processes

Adrian Veith
I have written a neko .ndll which can start a process in windows without
opening a console window and capture its output. I will put it in my
pascal4neko repository at google code.

Cheers, Adrian.

--

Veith System GmbH
Laiming 3
83112 Frasdorf - Germany

Tel: +49-(0)8052-2636
Fax: +49-(0)8052-4019
USt.-IdNr.: DE 131 200 756
Handelsregister: Traunstein B4434
Geschäftsführer: Ulrich Veith, Adrian Veith



Obi schrieb:

> Hi,
> I've been working for several weeks with haxe (especially targeting neko).
> So I build up one little neko web app which runs under mod_neko (my
> current machine is windows based).
>
> It is very simple one and has only one main method:
> public static function main():Void
> {
> var args:Array<String> = neko.Web.getParamsString().split("&");
> var prc:Process = new Process(args.shift(), args);
> trace(prc.exitCode());
> }
>
> If I compile it to neko byte code & try to invoke it via mod_neko like
> this for example:
> http://localhost/TestExec.n?haxe
>
> It executes 'haxe.exe', but one console window get poped up during its
> execution.
> So my question is there any possible way to run hidden processes via
> haxe/nekovm where their window  is not shown.
>
> PS. tried with neko.Sys.command , which acts the same.
>
>  


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: nekovm hidden Processes

Juan Delgado
Hi there,

This is an old request of mine for SWHX, could you make this part of
an independent dll or offer a general patch for Neko/SWHX so other
projects can reuse without problems?

That'd be nice : )

Ta,

Juan

On Fri, Nov 13, 2009 at 11:40 AM, Adrian Veith <[hidden email]> wrote:

> I have written a neko .ndll which can start a process in windows without
> opening a console window and capture its output. I will put it in my
> pascal4neko repository at google code.
>
> Cheers, Adrian.
>
> --
>
> Veith System GmbH
> Laiming 3
> 83112 Frasdorf - Germany
>
> Tel: +49-(0)8052-2636
> Fax: +49-(0)8052-4019
> USt.-IdNr.: DE 131 200 756
> Handelsregister: Traunstein B4434
> Geschäftsführer: Ulrich Veith, Adrian Veith
>
>
>
> Obi schrieb:
>> Hi,
>> I've been working for several weeks with haxe (especially targeting neko).
>> So I build up one little neko web app which runs under mod_neko (my
>> current machine is windows based).
>>
>> It is very simple one and has only one main method:
>>       public static function main():Void
>>       {
>>               var args:Array<String> = neko.Web.getParamsString().split("&");
>>               var prc:Process = new Process(args.shift(), args);
>>               trace(prc.exitCode());
>>       }
>>
>> If I compile it to neko byte code & try to invoke it via mod_neko like
>> this for example:
>> http://localhost/TestExec.n?haxe
>>
>> It executes 'haxe.exe', but one console window get poped up during its
>> execution.
>> So my question is there any possible way to run hidden processes via
>> haxe/nekovm where their window  is not shown.
>>
>> PS. tried with neko.Sys.command , which acts the same.
>>
>>
>
>
> --
> haXe - an open source web programming language
> http://haxe.org
>



--
Juan Delgado - Zárate
http://zarate.tv
http://blog.zarate.tv

--
haXe - an open source web programming language
http://haxe.org
obi
Reply | Threaded
Open this post in threaded view
|

Re: nekovm hidden Processes

obi
In reply to this post by obi
Hi Adrian,
Very cool that you have it already written. Can you give me a hint
where is the .ndll or sources for it located ? hidden process creation
will be used for this open project:
http://github.com/outbounder/DAssista (some more info at obi.wizartworx.com)
I've started one hiddren process implementation in the meanwhile, just
in case that nobody hadn't written such, but in git :)
(http://github.com/outbounder/neko.prc)
Is it possible to you putting your implementation at github also, so I
can collaborate by forking it ? :)

Note: I've last used pascal before 7 and c++ before 5 years ;)

> From: Adrian Veith <[hidden email]>
> Subject: Re: [haXe] nekovm hidden Processes
> To: [hidden email]
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> I have written a neko .ndll which can start a process in windows without
> opening a console window and capture its output. I will put it in my
> pascal4neko repository at google code.
>
> Cheers, Adrian.
>
> --
>
> Veith System GmbH
> Laiming 3
> 83112 Frasdorf - Germany
>
> Tel: +49-(0)8052-2636
> Fax: +49-(0)8052-4019
> USt.-IdNr.: DE 131 200 756
> Handelsregister: Traunstein B4434
> Geschäftsführer: Ulrich Veith, Adrian Veith
>
>
>
> Obi schrieb:
>> Hi,
>> I've been working for several weeks with haxe (especially targeting neko).
>> So I build up one little neko web app which runs under mod_neko (my
>> current machine is windows based).
>>
>> It is very simple one and has only one main method:
>>       public static function main():Void
>>       {
>>               var args:Array<String> = neko.Web.getParamsString().split("&");
>>               var prc:Process = new Process(args.shift(), args);
>>               trace(prc.exitCode());
>>       }
>>
>> If I compile it to neko byte code & try to invoke it via mod_neko like
>> this for example:
>> http://localhost/TestExec.n?haxe
>>
>> It executes 'haxe.exe', but one console window get poped up during its
>> execution.
>> So my question is there any possible way to run hidden processes via
>> haxe/nekovm where their window  is not shown.
>>
>> PS. tried with neko.Sys.command , which acts the same.
>>
>>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: nekovm hidden Processes

Laurent Kappler
Hi Obi,

What is DAssistA for?
What are pdmlfiles for also?

thanks, looks good :)
Laurent

Obi a écrit :

> Hi Adrian,
> Very cool that you have it already written. Can you give me a hint
> where is the .ndll or sources for it located ? hidden process creation
> will be used for this open project:
> http://github.com/outbounder/DAssista (some more info at obi.wizartworx.com)
> I've started one hiddren process implementation in the meanwhile, just
> in case that nobody hadn't written such, but in git :)
> (http://github.com/outbounder/neko.prc)
> Is it possible to you putting your implementation at github also, so I
> can collaborate by forking it ? :)
>
> Note: I've last used pascal before 7 and c++ before 5 years ;)
>
>  
>> From: Adrian Veith <[hidden email]>
>> Subject: Re: [haXe] nekovm hidden Processes
>> To: [hidden email]
>> Message-ID: <[hidden email]>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> I have written a neko .ndll which can start a process in windows without
>> opening a console window and capture its output. I will put it in my
>> pascal4neko repository at google code.
>>
>> Cheers, Adrian.
>>
>> --
>>
>> Veith System GmbH
>> Laiming 3
>> 83112 Frasdorf - Germany
>>
>> Tel: +49-(0)8052-2636
>> Fax: +49-(0)8052-4019
>> USt.-IdNr.: DE 131 200 756
>> Handelsregister: Traunstein B4434
>> Geschäftsführer: Ulrich Veith, Adrian Veith
>>
>>
>>
>> Obi schrieb:
>>    
>>> Hi,
>>> I've been working for several weeks with haxe (especially targeting neko).
>>> So I build up one little neko web app which runs under mod_neko (my
>>> current machine is windows based).
>>>
>>> It is very simple one and has only one main method:
>>>       public static function main():Void
>>>       {
>>>               var args:Array<String> = neko.Web.getParamsString().split("&");
>>>               var prc:Process = new Process(args.shift(), args);
>>>               trace(prc.exitCode());
>>>       }
>>>
>>> If I compile it to neko byte code & try to invoke it via mod_neko like
>>> this for example:
>>> http://localhost/TestExec.n?haxe
>>>
>>> It executes 'haxe.exe', but one console window get poped up during its
>>> execution.
>>> So my question is there any possible way to run hidden processes via
>>> haxe/nekovm where their window  is not shown.
>>>
>>> PS. tried with neko.Sys.command , which acts the same.
>>>
>>>
>>>      
>
>  


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: nekovm hidden Processes

Adrian Veith
In reply to this post by obi
Hi,

I just uploaded it to http://code.google.com/p/pascal4neko/ in the svn
repository. the process stuff is mainly a wrapper for some routines from
jedi component library.

cheers,

Adrian.

Obi schrieb:

> Hi Adrian,
> Very cool that you have it already written. Can you give me a hint
> where is the .ndll or sources for it located ? hidden process creation
> will be used for this open project:
> http://github.com/outbounder/DAssista (some more info at obi.wizartworx.com)
> I've started one hiddren process implementation in the meanwhile, just
> in case that nobody hadn't written such, but in git :)
> (http://github.com/outbounder/neko.prc)
> Is it possible to you putting your implementation at github also, so I
> can collaborate by forking it ? :)
>
> Note: I've last used pascal before 7 and c++ before 5 years ;)
>
>  
>> From: Adrian Veith <[hidden email]>
>> Subject: Re: [haXe] nekovm hidden Processes
>> To: [hidden email]
>> Message-ID: <[hidden email]>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> I have written a neko .ndll which can start a process in windows without
>> opening a console window and capture its output. I will put it in my
>> pascal4neko repository at google code.
>>
>> Cheers, Adrian.
>>
>> --
>>
>> Veith System GmbH
>> Laiming 3
>> 83112 Frasdorf - Germany
>>
>> Tel: +49-(0)8052-2636
>> Fax: +49-(0)8052-4019
>> USt.-IdNr.: DE 131 200 756
>> Handelsregister: Traunstein B4434
>> Geschäftsführer: Ulrich Veith, Adrian Veith
>>
>>
>>
>> Obi schrieb:
>>    
>>> Hi,
>>> I've been working for several weeks with haxe (especially targeting neko).
>>> So I build up one little neko web app which runs under mod_neko (my
>>> current machine is windows based).
>>>
>>> It is very simple one and has only one main method:
>>>       public static function main():Void
>>>       {
>>>               var args:Array<String> = neko.Web.getParamsString().split("&");
>>>               var prc:Process = new Process(args.shift(), args);
>>>               trace(prc.exitCode());
>>>       }
>>>
>>> If I compile it to neko byte code & try to invoke it via mod_neko like
>>> this for example:
>>> http://localhost/TestExec.n?haxe
>>>
>>> It executes 'haxe.exe', but one console window get poped up during its
>>> execution.
>>> So my question is there any possible way to run hidden processes via
>>> haxe/nekovm where their window  is not shown.
>>>
>>> PS. tried with neko.Sys.command , which acts the same.
>>>
>>>
>>>      
>
>  


--
haXe - an open source web programming language
http://haxe.org
obi
Reply | Threaded
Open this post in threaded view
|

Re: nekovm hidden Processes

obi
In reply to this post by obi
Hi Adrian,
I've checked out your code implementation, it is working just fine 10x.
But I wonder - how is possible to start a process and wait for it to
terminate via haxe?

using this did not make it:
class TestPrc
{
        public function new() { }
       
        private static var terminated:Bool;
       
        public static function main():Bool
        {
                terminated = false;
               
                var prc:Process = new Process();
                prc.setHandler(onRead, onTerminate, onError);
                prc.startProcess("haxe.exe", ["--version"]);
                var state:Int = 0;
                while (!terminated)
                        state = prc.getState();
                prc.free();
                return true;
        }
       
        private static function onRead(value:neko.NativeString,newLine:Bool):Void
        {
                trace("read:" + value);
        }
       
        private static function onTerminate(value:Int):Void
        {
                trace("terminate:" + value);
                terminated = true;
        }
       
        private static function onError(value:neko.NativeString,newLine:Bool):Void
        {
                trace("error:" + value);
        }
}

Code above falls in infinite loop invoked via mod_neko. Does the
process should be created in separate thread or I'm missing something?

Thanks again,
Boris

> Date: Mon, 16 Nov 2009 16:48:47 +0100
> From: Adrian Veith <[hidden email]>
> Subject: Re: [haXe] nekovm hidden Processes
> To: The haXe compiler list <[hidden email]>
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi,
>
> I just uploaded it to http://code.google.com/p/pascal4neko/ in the svn
> repository. the process stuff is mainly a wrapper for some routines from
> jedi component library.
>
> cheers,
>
> Adrian.
>
> Obi schrieb:
>> Hi Adrian,
>> Very cool that you have it already written. Can you give me a hint
>> where is the .ndll or sources for it located ? hidden process creation
>> will be used for this open project:
>> http://github.com/outbounder/DAssista (some more info at obi.wizartworx.com)
>> I've started one hiddren process implementation in the meanwhile, just
>> in case that nobody hadn't written such, but in git :)
>> (http://github.com/outbounder/neko.prc)
>> Is it possible to you putting your implementation at github also, so I
>> can collaborate by forking it ? :)
>>
>> Note: I've last used pascal before 7 and c++ before 5 years ;)
>>
>>
>>> From: Adrian Veith <[hidden email]>
>>> Subject: Re: [haXe] nekovm hidden Processes
>>> To: [hidden email]
>>> Message-ID: <[hidden email]>
>>> Content-Type: text/plain; charset=ISO-8859-1
>>>
>>> I have written a neko .ndll which can start a process in windows without
>>> opening a console window and capture its output. I will put it in my
>>> pascal4neko repository at google code.
>>>
>>> Cheers, Adrian.
>>>
>>> --
>>>
>>> Veith System GmbH
>>> Laiming 3
>>> 83112 Frasdorf - Germany
>>>
>>> Tel: +49-(0)8052-2636
>>> Fax: +49-(0)8052-4019
>>> USt.-IdNr.: DE 131 200 756
>>> Handelsregister: Traunstein B4434
>>> Geschäftsführer: Ulrich Veith, Adrian Veith
>>>
>>>
>>>
>>> Obi schrieb:
>>>
>>>> Hi,
>>>> I've been working for several weeks with haxe (especially targeting neko).
>>>> So I build up one little neko web app which runs under mod_neko (my
>>>> current machine is windows based).
>>>>
>>>> It is very simple one and has only one main method:
>>>>       public static function main():Void
>>>>       {
>>>>               var args:Array<String> = neko.Web.getParamsString().split("&");
>>>>               var prc:Process = new Process(args.shift(), args);
>>>>               trace(prc.exitCode());
>>>>       }
>>>>
>>>> If I compile it to neko byte code & try to invoke it via mod_neko like
>>>> this for example:
>>>> http://localhost/TestExec.n?haxe
>>>>
>>>> It executes 'haxe.exe', but one console window get poped up during its
>>>> execution.
>>>> So my question is there any possible way to run hidden processes via
>>>> haxe/nekovm where their window  is not shown.
>>>>
>>>> PS. tried with neko.Sys.command , which acts the same.
>>>>
>>>>
>>>>
>>
>>
>
>
>
>
> ------------------------------
>
> _______________________________________________
> Haxe mailing list
> [hidden email]
> http://lists.motion-twin.com/mailman/listinfo/haxe
>
>
> End of Haxe Digest, Vol 49, Issue 66
> ************************************
>

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: nekovm hidden Processes

Adrian Veith
Hi Boris,

I use the following code, to run a hidden command  console on a server
and forward the output to a client:

import haxe.remoting.Context;
import haxe.remoting.HttpConnection;

#if neko
import neko.vm.Thread;
import neko.NativeString;
import neko.Sys;
import neko.Web;
import neko.Lib;
import neko.Utf8;
import tim.TimDB;
#end
import haxe.Timer;
import p4n.Process;

typedef BufInfo = {
    var buf: String;
    var last: String;
}
#if neko

private class SessionInfo {
    public var pro: Process;
    public var Out: Array<String>;
    public var lastLine: String;  
    public var stamp: Float;
    public var id: String;
    public function new(AId: String) {
        //terminated = false;
        id = AId;
        stamp = Timer.stamp();
        Out = new Array();
        lastLine = null;
        pro = new Process();
        pro.setHandler(onRead, onTerminate, null);
        var sc = Sys.environment().get('ComSpec');
        if (sc == null || sc == "") sc = 'COMMAND.EXE';
        pro.startProcess(sc);
        var sPath = Web.getCwd();
        if (sPath.charAt(1) == ':') {
            pro.writeln(sPath.substr(0, 2) + ' /D');
            pro.writeln('cd ' + sPath);
        }
    }
    private function onRead(s: NativeString, nl: Bool): Void {
        //trace(lastLine);
        if (nl) {
            if (lastLine != null)
                Out.push(lastLine);
            lastLine = NativeString.toString(s);
        }
        else {
            if (lastLine != null) lastLine += s
            else lastLine = NativeString.toString(s);
        }
    }
    private function onTerminate(code: Int) {
        if (lastLine != null) Out.push(lastLine);
        Out.push('terminated: ' + code);
        //terminated = true;
        lastLine = null;
    }
}
#end

class ConsoleSrv {
    static var ctx: Context;
    static var siHash: Hash<SessionInfo>;
   
    private static function getSessionInfo(?sID: String): SessionInfo {
        if (sID == null)
            sID = Web.getCookies().get('TimSessionToken');
        var sn = if (sID != null) siHash.get(sID) else null;
        if (sn != null) sn.stamp = Timer.stamp();
        return sn;
    }
    public function new() {
    }
    public function login(idSn: String, pw: String): String {
    try { // the session is handled
      var sn = TimDB.getSession(idSn, true);
            trace(sn.Token());
            if (sn != null) {
                if (! sn.login('-', pw)) {
                    sn.Clear();
                    sn = null;
                } else {
                    siHash.set(sn.Token(), new
SessionInfo(sn.Token()));                  
                    Web.setCookie('TimSessionToken', sn.Token());
                }
            }
            return if (sn != null) sn.Token() else "";
    }
    catch (e: Dynamic) {
      return "Error:" +idSn + " ist ungültig.";
    }
  }

    public function getOutput(): BufInfo {
        var si = getSessionInfo();
        if (si == null) return { buf: "", last: null };
        var s = si.Out.join('\r\n');
        si.Out = new Array();
        return {buf: Utf8.encode(s), last: if (si.lastLine != null)
Utf8.encode(si.lastLine) else null};
    }
    public function getState(): Int {
        var si = getSessionInfo();
        return if (si != null) si.pro.getState() else -1;
    }
    public function execute(s: String) {
        var si = getSessionInfo();
        if (si != null) {
            if (s.length == 2 && s.charAt(1) == "#")
                si.pro.write(s.substr(0, 1))
            else
                si.pro.writeln(s);
        }
    }
    public function terminate(?sID: String) {
        handleTerminate(sID);
        if (sID == null) Web.setCookie('TimSessionToken', '');
    }
   
    static function handleTerminate(?sID: String) {
        var si = getSessionInfo(sID);
        if (si != null) {
            si.pro.terminate();
            si.pro.getState();
        }
        if (sID == null)
            sID = Web.getCookies().get('TimSessionToken');
        if (sID != null) {
            var sn = TimDB.getSession(sID, false);
            if (sn != null) sn.Clear();
        }      
    }
  static function handleRequest() {
    var isNekoRequest = HttpConnection.handleRequest(ctx);
    if( isNekoRequest )
      return;
    // handle normal request
        Lib.print(Web.getHostName());
        Web.redirect('index.html');
  }
    static function checkSessions() {
        var stamp = Timer.stamp() - 1 * 60.0;
        for (sn in siHash.iterator()) {
            if (sn.stamp < stamp) {
                handleTerminate(sn.id);
            }
        }
    }
  static function main() {
    ctx = new Context();
        siHash = new Hash();
    ctx.addObject("Console",new ConsoleSrv());
    neko.Web.cacheModule(handleRequest);
    handleRequest();
        Thread.create(function() { while (true) { checkSessions();
Sys.sleep(10);} } );
  }
   
}

And yes, you should create an extra thread, to keep the communication
running;

Hope this helps,

Adrian.

Obi schrieb:

> Hi Adrian,
> I've checked out your code implementation, it is working just fine 10x.
> But I wonder - how is possible to start a process and wait for it to
> terminate via haxe?
>
> using this did not make it:
> class TestPrc
> {
> public function new() { }
>
> private static var terminated:Bool;
>
> public static function main():Bool
> {
> terminated = false;
>
> var prc:Process = new Process();
> prc.setHandler(onRead, onTerminate, onError);
> prc.startProcess("haxe.exe", ["--version"]);
> var state:Int = 0;
> while (!terminated)
> state = prc.getState();
> prc.free();
> return true;
> }
>
> private static function onRead(value:neko.NativeString,newLine:Bool):Void
> {
> trace("read:" + value);
> }
>
> private static function onTerminate(value:Int):Void
> {
> trace("terminate:" + value);
> terminated = true;
> }
>
> private static function onError(value:neko.NativeString,newLine:Bool):Void
> {
> trace("error:" + value);
> }
> }
>
> Code above falls in infinite loop invoked via mod_neko. Does the
> process should be created in separate thread or I'm missing something?
>
> Thanks again,
> Boris
>
>  
>> Date: Mon, 16 Nov 2009 16:48:47 +0100
>> From: Adrian Veith <[hidden email]>
>> Subject: Re: [haXe] nekovm hidden Processes
>> To: The haXe compiler list <[hidden email]>
>> Message-ID: <[hidden email]>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Hi,
>>
>> I just uploaded it to http://code.google.com/p/pascal4neko/ in the svn
>> repository. the process stuff is mainly a wrapper for some routines from
>> jedi component library.
>>
>> cheers,
>>
>> Adrian.
>>
>> Obi schrieb:
>>    
>>> Hi Adrian,
>>> Very cool that you have it already written. Can you give me a hint
>>> where is the .ndll or sources for it located ? hidden process creation
>>> will be used for this open project:
>>> http://github.com/outbounder/DAssista (some more info at obi.wizartworx.com)
>>> I've started one hiddren process implementation in the meanwhile, just
>>> in case that nobody hadn't written such, but in git :)
>>> (http://github.com/outbounder/neko.prc)
>>> Is it possible to you putting your implementation at github also, so I
>>> can collaborate by forking it ? :)
>>>
>>> Note: I've last used pascal before 7 and c++ before 5 years ;)
>>>
>>>
>>>      
>>>> From: Adrian Veith <[hidden email]>
>>>> Subject: Re: [haXe] nekovm hidden Processes
>>>> To: [hidden email]
>>>> Message-ID: <[hidden email]>
>>>> Content-Type: text/plain; charset=ISO-8859-1
>>>>
>>>> I have written a neko .ndll which can start a process in windows without
>>>> opening a console window and capture its output. I will put it in my
>>>> pascal4neko repository at google code.
>>>>
>>>> Cheers, Adrian.
>>>>
>>>> --
>>>>
>>>> Veith System GmbH
>>>> Laiming 3
>>>> 83112 Frasdorf - Germany
>>>>
>>>> Tel: +49-(0)8052-2636
>>>> Fax: +49-(0)8052-4019
>>>> USt.-IdNr.: DE 131 200 756
>>>> Handelsregister: Traunstein B4434
>>>> Geschäftsführer: Ulrich Veith, Adrian Veith
>>>>
>>>>
>>>>
>>>> Obi schrieb:
>>>>
>>>>        
>>>>> Hi,
>>>>> I've been working for several weeks with haxe (especially targeting neko).
>>>>> So I build up one little neko web app which runs under mod_neko (my
>>>>> current machine is windows based).
>>>>>
>>>>> It is very simple one and has only one main method:
>>>>>       public static function main():Void
>>>>>       {
>>>>>               var args:Array<String> = neko.Web.getParamsString().split("&");
>>>>>               var prc:Process = new Process(args.shift(), args);
>>>>>               trace(prc.exitCode());
>>>>>       }
>>>>>
>>>>> If I compile it to neko byte code & try to invoke it via mod_neko like
>>>>> this for example:
>>>>> http://localhost/TestExec.n?haxe
>>>>>
>>>>> It executes 'haxe.exe', but one console window get poped up during its
>>>>> execution.
>>>>> So my question is there any possible way to run hidden processes via
>>>>> haxe/nekovm where their window  is not shown.
>>>>>
>>>>> PS. tried with neko.Sys.command , which acts the same.
>>>>>
>>>>>
>>>>>
>>>>>          
>>>      
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> Haxe mailing list
>> [hidden email]
>> http://lists.motion-twin.com/mailman/listinfo/haxe
>>
>>
>> End of Haxe Digest, Vol 49, Issue 66
>> ************************************
>>
>>    
>
>  


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: nekovm hidden Processes

Nicolas Cannasse
In reply to this post by Adrian Veith
Adrian Veith a écrit :
> I have written a neko .ndll which can start a process in windows without
> opening a console window and capture its output. I will put it in my
> pascal4neko repository at google code.

Actually neko.io.Process should no longer open a console with latest
Neko release. If it still does, then this is an issue that needs to be
fixed ;)

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Re: nekovm hidden Processes

Nicolas Cannasse
In reply to this post by obi
Obi a écrit :
> Hi Adrian,
> I've checked out your code implementation, it is working just fine 10x.
> But I wonder - how is possible to start a process and wait for it to
> terminate via haxe?

Read the .exitCode()

Nicolas

--
haXe - an open source web programming language
http://haxe.org