Re: [PD] [popen] and PHP on windows
Thanks, but i try to start two .bat in the same time and it doesn't work. So i decide to forget windows ;) I read somewhere it is possible to do it with two .exe but i have not enough time to test it. ++ Jack Le 10 sept. 08 à 19:59, patco a écrit : you can add the variable to the filename, and get it with %1 %2 ... I guess you know how to send it to php, you can also use a socket for this and [netsend] How do you do to receive a variable in a .bat to send (in my exemple) 10 to 'arbre.php' ? (Pd send 10 to .bat then .bat send 10 to PHP). Thanx ++ Jack however, I usually write a batch file and start the .bat file with popen, and problems goes away. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
[PD] [popen] and PHP on windows
Hello All ! I'm looking for the right method to execute a .php with [popen] on Windows (before, all works fine under OSX, i was using [ggee/shell]). Here is what i do : [ C:/wamp/bin/php/php5.2.6/php.exe -f C:/wamp/www/ADM/arbre.php 10 ( | [popen] When i click on this message, Windows open a Command Prompt window and close it immediately, but i receive nothing with Pd. However, when i enter directely 'C:/wamp/bin/php/php5.2.6/php.exe -f C:/wamp/www/ADM/arbre.php 10' in a Command Prompt window and press 'Enter', all works fine and Pd receive the datas. Any Idea about my problem ? Thanks. ++ Jack ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] [popen] and PHP on windows
Le mercredi 10 septembre 2008 à 18:16 +0200, Jack a écrit : However, when i enter directely 'C:/wamp/bin/php/php5.2.6/php.exe -f C:/wamp/www/ADM/arbre.php 10' in a Command Prompt window and press 'Enter', all works fine and Pd receive the datas. it's hard to believe that cmd is able to read slashes like backslashes however, I usually write a batch file and start the .bat file with popen, and problems goes away. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] [popen] and PHP on windows
Le 10 sept. 08 à 19:01, patco a écrit : Le mercredi 10 septembre 2008 à 18:16 +0200, Jack a écrit : However, when i enter directely 'C:/wamp/bin/php/php5.2.6/php.exe -f C:/wamp/www/ADM/arbre.php 10' in a Command Prompt window and press 'Enter', all works fine and Pd receive the datas. it's hard to believe that cmd is able to read slashes like backslashes Yes, you are right, it was backslashes, i just do copy and paste sorry ;) How do you do to receive a variable in a .bat to send (in my exemple) 10 to 'arbre.php' ? (Pd send 10 to .bat then .bat send 10 to PHP). Thanx ++ Jack however, I usually write a batch file and start the .bat file with popen, and problems goes away. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] [popen] and PHP on windows
you can add the variable to the filename, and get it with %1 %2 ... I guess you know how to send it to php, you can also use a socket for this and [netsend] How do you do to receive a variable in a .bat to send (in my exemple) 10 to 'arbre.php' ? (Pd send 10 to .bat then .bat send 10 to PHP). Thanx ++ Jack however, I usually write a batch file and start the .bat file with popen, and problems goes away. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] [popen] and PHP on windows
Hallo, patco hat gesagt: // patco wrote: Le mercredi 10 septembre 2008 à 18:16 +0200, Jack a écrit : However, when i enter directely 'C:/wamp/bin/php/php5.2.6/php.exe -f C:/wamp/www/ADM/arbre.php 10' in a Command Prompt window and press 'Enter', all works fine and Pd receive the datas. it's hard to believe that cmd is able to read slashes like backslashes I think, some implementations of popen can do that. Maybe the one attached written in pdlua works on MS-Windows, too (cannot check for lack of MS-Windows). Ciao -- Frank #N canvas 0 0 450 300 10; #X obj 136 123 list prepend run; #X obj 136 145 list trim; #X msg 45 129 run ls /tmp; #X obj 139 170 luaopen; #X obj 139 227 print luaopen; #X obj 185 192 print errors; #X msg 136 92 ls /home/me; #X connect 0 0 1 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 1 5 0; #X connect 6 0 0 0; local pdclassname = luaopen local M = pd.Class:new():register(pdclassname) function M:initialize(name, atoms) self.inlets = 1 self.outlets = 2 return true end function M:in_1_run(args) local cmd = table.concat(args, ) -- instead of io.popen os.execute may be interesting as well. local result, err = io.popen(cmd) if result then for l in result:lines() do self:outlet(1, list, {l}) end result:close() else self:outlet(2, error, {err}) end end ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list
Re: [PD] [popen] and PHP on windows
Hi, Perhaps because I have CYGWIN installed, my [popen] accepted back slashes. I wrote a script that ouputs ($argv[1] * 2) and sent it the following message. [php c:/phptest.php 10 results were good. -- David Shimamoto Le 10 sept. 08 à 19:01, patco a écrit : Le mercredi 10 septembre 2008 à 18:16 +0200, Jack a écrit : However, when i enter directely 'C:/wamp/bin/php/php5.2.6/php.exe -f C:/wamp/www/ADM/arbre.php 10' in a Command Prompt window and press 'Enter', all works fine and Pd receive the datas. it's hard to believe that cmd is able to read slashes like backslashes Yes, you are right, it was backslashes, i just do copy and paste sorry ;) How do you do to receive a variable in a .bat to send (in my exemple) 10 to 'arbre.php' ? (Pd send 10 to .bat then .bat send 10 to PHP). Thanx ++ Jack however, I usually write a batch file and start the .bat file with popen, and problems goes away. ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list ___ Pd-list@iem.at mailing list UNSUBSCRIBE and account-management - http://lists.puredata.info/listinfo/pd-list