You need to be a bit more descriptive of what "doesn't work" mean, otherwise we can't help you. :) Have you seen this? http://pharo.gemtalksystems.com/book/PharoTools/OSProcess/ Also there's a new lib for OS http://forum.world.st/ANN-OSSubprocess-v0-2-0-release-td4872820.html ( https://github.com/marianopeck/OSSubprocess ) Peter On Fri, Mar 18, 2016 at 2:45 PM, Guillaume Ongenae <[hidden email]> wrote:
|
HI Guillaume, I don't have much to add to what Peter said. As for OSProcess yes, we have some problems in latest VMs / images. At some point stdout redirection was not working. Then it seems it got fixed but now I am not sure if it is working as there were other people reporting it didn't work. As for OSSubprocess, if you are using Pharo 5.0, then it should work. If you have questions (the docs cover quite some questions), please let me know. On Fri, Mar 18, 2016 at 10:51 AM, Peter Uhnák <[hidden email]> wrote:
|
In reply to this post by Peter Uhnak
Thanks for the answer,
I've already seen this page. And the problem is when I do : OSProcess command: 'touch files.txt', I can't find the created files. But I don't have any error message. For the new lib, I'm working on Pharo 4, and it only works and version 5. -- Guillaume |
if you do something like this: | p d | p := (PipeableOSProcess command: 'touch files.txt'). p keepInitialStdOutOpen: true. d := Delay forMilliseconds: 250. d wait. [Transcript show: (p next: 300); flush. p atEnd] whileFalse: [d wait]. Transcript show: (p errorUpToEnd). p closeOutput. then you'll get this for output: touch: files.txt: Permission denied because you're trying to do a touch in the root directory On Fri, Mar 18, 2016 at 6:41 AM, g_ongenae <[hidden email]> wrote: Thanks for the answer, |
continued... (this is on Mac OSX, but it should be the same on any *nix). I don't do Windows. If you want to see the file try touch ~/files.txt By the way, the code above works in Pharo 4.0, should work with the latest Pharo 5.0 beta, but I haven't tested the code above with Pharo 5.0. On Fri, Mar 18, 2016 at 10:35 PM, john pfersich <[hidden email]> wrote:
|
On Sat, Mar 19, 2016 at 9:16 AM, john pfersich <[hidden email]> wrote:
I don't actually see the reason why it should assume root folder if you don't specify a path… that's stupid on many levels (I blame mac). On Linux you get home, although that's imho also wrong and it should use the folder of the image… but maybe that's a misconfiguration of OSProcess. Peter |
On 19 March 2016 at 16:45, Peter Uhnák <[hidden email]> wrote:
It's root because that's where the system launches applications from, when you double-click them in the Finder (or via the open command, I think). You'll see that GUI-launched images do not inherit your shell environment either. However, if you run pharo from command-line, you get the usual unix behavior.
No, it's the same logic than on Mac (albeit $HOME is arguably a little more sensible than the filesystem's root). I'm not sure what's the correct behavior here, unless there is a way to know if pharo was launched from GUI (where working directory is meaningless and pharo should probably chdir() to the image directory) or from command-line (where the working directory is meaningful and should be honored. On OSX, maybe there's a way to pass GUI-specific arguments, through the Info.plist file? |
I seem to recall that on the mac there was a system option of some
sort that "launches apps from a sensible" location --- of course the
Apple powers that be may have removed that capability recently...
Dale On 3/19/16 9:41 AM, Damien Pollet
wrote:
|
Free forum by Nabble | Edit this page |