[Pharo-project] OSProcess in Pharo 2.0
Hi, I was trying to play with OSProcess. Simple goal, to execute $ ldconfig -p | grep libcairo.so and get the result as a string or stream. Several problems I met: - newest OSProcess loaded from its configuration depends on FileDirectory which is not present in Pharo 2.0. - when I fixed previous point I wondered how to get the output of a particular command. Damien P. told me I had to use the particular OSProcess of Coral or use CommandShell - I tried installing CommandShell but its configuration depends on PluggableTextView which is not in Pharo 2.0 - when I fixed previous point, I realized CommandShell depends even more on FileSystem and I didn't understand how to get the output stream - so I gave up with CommandShell and tried Coral's OSProcess - So I fixed some references to FileDirectory again but then many unit tests of OSProcess didn't pass so I felt uncomfortable At the end, Coral's OSProcess worked for me, but I don't know why all these tests are failing -- Damien Cassou http://damiencassou.seasidehosting.st "Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
On 2012-10-30, at 10:15, Damien Cassou <damien.cassou@gmail.com> wrote:
Hi,
I was trying to play with OSProcess. Simple goal, to execute
$ ldconfig -p | grep libcairo.so
and get the result as a string or stream.
Several problems I met:
- newest OSProcess loaded from its configuration depends on FileDirectory which is not present in Pharo 2.0.
Didn't have time yet to fix this: https://code.google.com/p/pharo/issues/detail?id=6740
- when I fixed previous point I wondered how to get the output of a particular command. Damien P. told me I had to use the particular OSProcess of Coral or use CommandShell
=> PipeableOSProcess is your friend It works somehow, but in my experience is not that stable
- I tried installing CommandShell but its configuration depends on PluggableTextView which is not in Pharo 2.0 - when I fixed previous point, I realized CommandShell depends even more on FileSystem and I didn't understand how to get the output stream - so I gave up with CommandShell and tried Coral's OSProcess - So I fixed some references to FileDirectory again but then many unit tests of OSProcess didn't pass so I felt uncomfortable
At the end, Coral's OSProcess worked for me, but I don't know why all these tests are failing
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
Hi, I'm not up to speed on the latest Pharo, but I'll try to offer a couple of tips... On Tue, Oct 30, 2012 at 10:15:12AM +0100, Damien Cassou wrote:
Hi,
I was trying to play with OSProcess. Simple goal, to execute
$ ldconfig -p | grep libcairo.so
and get the result as a string or stream.
Several problems I met:
- newest OSProcess loaded from its configuration depends on FileDirectory which is not present in Pharo 2.0.
Hopefully it will be possible to provide some kind of compatibility layer to deal with this. The CommandShell repository already has a CommandShellPharo package that I made in November 2010 to address menu registration changes in Pharo at that time. I have not tried to keep up with the Pharo 2.0 changes, but if a compatibility package is possible, this might be a good place to put it.
- when I fixed previous point I wondered how to get the output of a particular command. Damien P. told me I had to use the particular OSProcess of Coral or use CommandShell - I tried installing CommandShell but its configuration depends on PluggableTextView which is not in Pharo 2.0
I split the CommandShell package into subpackages in order to address this. I guess we need a ConfigurationOfCommandShell to handle this properly, but if you load the individual sub-packages (e.g. CommandShell-base and friends, instead of CommandShell which contains all of the subpackages), and omit the CommandShell-MVC package, then you will not have this problem. PluggableTextView is part of the MVC package (a command shell can be opened in either Morphic or MVC). HTH, Dave
- when I fixed previous point, I realized CommandShell depends even more on FileSystem and I didn't understand how to get the output stream - so I gave up with CommandShell and tried Coral's OSProcess - So I fixed some references to FileDirectory again but then many unit tests of OSProcess didn't pass so I felt uncomfortable
At the end, Coral's OSProcess worked for me, but I don't know why all these tests are failing
-- Damien Cassou http://damiencassou.seasidehosting.st
"Success is the ability to go from one failure to another without losing enthusiasm." Winston Churchill
participants (3)
-
Camillo Bruni -
Damien Cassou -
David T. Lewis