Login  Register

Re: Use Shell Command from Pharo

Posted by John Pfersich on Mar 19, 2016; 7:48am
URL: https://forum.world.st/Use-Shell-Command-from-Pharo-tp4885330p4885424.html

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:
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,

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



--
View this message in context: http://forum.world.st/Use-Shell-Command-from-Pharo-tp4885330p4885334.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.