command line command from pharo image
Sean wrote:
Sabine Knöfel wrote
Which is the Class and the message in NB then? not sure which class and on holidays with no computer :) the Mac message is #run: which wraps system in libc, and the Windows version, which I haven't committed yet is #winExec:show which wraps WinExec. HTH
Hi Sabine, Sean, PLEASE NO WinExec, this is long deprecated and only for 16bit compatibility see http://msdn.microsoft.com/en-us/library/windows/desktop/ms687393(v=vs.85).as... As you see on MSDN CreateProcess() API should be used. If you are on Pharo 3.0 look at my "OS-Windows" project loadable from the config browser. You will find the class WinProcess with methods like #createProcess: (nonblocking) and #createAndWaitForProcess: (blocking) there. It already uses CreateProcess API. With the package you can for instance run the command processor: WinProcess createAndWaitForProcess: 'cmd.exe' You also have access to the environment like WinEnvironment getEnvironmentVariable: 'PATH'. See the documentation at http://smalltalkhub.com/#!/~OS/OS-Windows for more examples. Bye T.
Torsten Bergmann wrote
PLEASE NO WinExec, this is long deprecated
Ha ha, yes Torsten. I couldn't get create process to work so I cheated ;) it works and takes only two parameters. This is exciting that you've already wrapped that stuff! I had no idea, there's probably so many great things out there. We could really use a PharoMap... I will take a look at your project. Maybe something could be integrated with NB core. Executing an external command on all the common platforms is a good demonstration of NB ----- Cheers, Sean -- View this message in context: http://forum.world.st/command-line-command-from-pharo-image-tp4727751p472785... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hi Torsten, Sean, http://smalltalkhub.com/#!/~OS/OS-Windows looks great. I have not found a solution yet to send a call to OS from pharo (I develop with mac since a few weeks now and deployment is currently windows) and I am thinking about moving to Pharo 3.0 for further development due to the OS call problem. Do you think, Pharo 3.0 is ready to use it for development or should I wait and look for another solution? Regards Sabine -- View this message in context: http://forum.world.st/command-line-command-from-pharo-image-tp4727751p472790... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
2013/12/6 Sabine Knöfel <sabine.knoefel@gmail.com>
Hi Torsten, Sean,
http://smalltalkhub.com/#!/~OS/OS-Windows looks great.
I have not found a solution yet to send a call to OS from pharo (I develop with mac since a few weeks now and deployment is currently windows) and I am thinking about moving to Pharo 3.0 for further development due to the OS call problem.
Do you think, Pharo 3.0 is ready to use it for development or should I wait and look for another solution?
Regards Sabine
-- View this message in context: http://forum.world.st/command-line-command-from-pharo-image-tp4727751p472790... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hi, Pharo2 doesn't work for you? I tried both Pharo2 and 3. In Pharo2.0 Latest update: #20593 with latest stable OSProcess loaded form ConfigurationManager I can execute OSProcess command:'notepad.exe' without problems. But only as long as the command can be found otherwise ExternalWindowsOSProcess tries to write that error message to ExternalWindowsOSProcess>>initialStdErr. And this does not work. (And it doesn't work in Pharo3) (bug StdErr not working on Windows https://pharo.fogbugz.com/default.asp?11615)
Nicolai, thank you very much for clarification. Indeed: there was a silly error in my command when copying it from Mac to windows (path) and the notepad test worked. So the problem is solved for me. I can call from Mac OS and from Windows and I am happy:-) Regards Sabine On Fri, Dec 6, 2013 at 1:43 PM, Nicolai Hess [via Smalltalk] < ml-node+s1294792n4727984h99@n4.nabble.com> wrote:
2013/12/6 Sabine Knöfel <[hidden email]<http://user/SendEmail.jtp?type=node&node=4727984&i=0>
Hi Torsten, Sean,
http://smalltalkhub.com/#!/~OS/OS-Windows looks great.
I have not found a solution yet to send a call to OS from pharo (I develop with mac since a few weeks now and deployment is currently windows) and I am thinking about moving to Pharo 3.0 for further development due to the OS call problem.
Do you think, Pharo 3.0 is ready to use it for development or should I wait and look for another solution?
Regards Sabine
-- View this message in context: http://forum.world.st/command-line-command-from-pharo-image-tp4727751p472790... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Hi,
Pharo2 doesn't work for you? I tried both Pharo2 and 3.
In Pharo2.0 Latest update: #20593 with latest stable OSProcess loaded form ConfigurationManager I can execute OSProcess command:'notepad.exe'
without problems.
But only as long as the command can be found otherwise ExternalWindowsOSProcess tries to write that error message to ExternalWindowsOSProcess>>initialStdErr. And this does not work. (And it doesn't work in Pharo3) (bug StdErr not working on Windows https://pharo.fogbugz.com/default.asp?11615)
------------------------------ If you reply to this email, your message will be added to the discussion below:
http://forum.world.st/command-line-command-from-pharo-image-tp4727751p472798... To start a new topic under Pharo Smalltalk Users, email ml-node+s1294792n1310670h65@n4.nabble.com To unsubscribe from command line command from pharo image, click here<http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&nod...> . NAML<http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant...>
-- View this message in context: http://forum.world.st/command-line-command-from-pharo-image-tp4727751p472803... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (4)
-
Nicolai Hess -
Sabine Knöfel -
Sean P. DeNigris -
Torsten Bergmann