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).aspx 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. |
Administrator
|
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 |
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 |
2013/12/6 Sabine Knöfel <[hidden email]> Hi Torsten, Sean, 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] <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |