Re: [Pharo-users] Using OSSubProcess to invoke Java

2016-06-20 Thread Alexandre Bergel
Yes it does! Thanks!!!

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



> On Jun 20, 2016, at 12:32 PM, Mariano Martinez Peck  
> wrote:
> 
> 
> 
> On Mon, Jun 20, 2016 at 1:10 PM, Peter Uhnák  > wrote:
> #runAndWaitOnExitDo: takes a cull-ed three-arg block with the process, 
> stdout, and stderr; that way you can process stdout and stderr independently.
> 
> 
> Exactly. 
>  
> Try this
> 
> OSSUnixSubprocess new
>   command: '/usr/bin/java';
>   arguments: #('-version');
>   redirectStderr;
>   runAndWaitOnExitDo: [ :process :out :err |
>   err inspect
>   ].
> 
> 
> Indeed. This is what I think should work. And yes, I don't think the 
> 'JAVA_HOME'  is needed. At least for this command.
> 
> Alex, let us know if Peter code worked.
> 
> Cheers, 
>  
> 
> Peter
> 
> On Mon, Jun 20, 2016 at 6:03 PM, Alexandre Bergel  > wrote:
> Hi Mark,
> 
> This is what I thought. But it does not seem to work. I tried:
> 
> OSSUnixSubprocess new
>   command: '/usr/bin/java';
>   arguments: #('-version');
> redirectStderr;
> 
>   runAndWaitOnExitDo: [ :process :outString  |
>   outString inspect
>   ].
> 
> Or is it the redirectStderr that does not work properly?
> 
> Cheers,
> Alexandre
> 
> 
> > On Jun 20, 2016, at 11:42 AM, Mark Bestley  > > wrote:
> >
> > java -version outputs to stderr not stdout (also I don't think you need 
> > JAVA_HOME /usr/bin/java will do what is needed)
> >
> >
> >
> > On 20/06/2016 15:58, Alexandre Bergel wrote:
> >
> >> On OS X, in a terminal, if I type: /usr/bin/java -version
> >> I obtain:
> >> java version "1.8.0_66"
> >> Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
> >> Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
> >>
> >> Using OSSubProcess, do-it-ing the following:
> >>
> >> OSSUnixSubprocess new
> >>   command: '/usr/bin/java';
> >>   arguments: #('-version');
> >>  environmentAt: 'JAVA_HOME' put: 
> >> '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home';
> >>  redirectStderr;
> >>   redirectStdout;
> >>   runAndWaitOnExitDo: [ :process :outString  |
> >>   outString inspect
> >>   ].
> >>
> >> inspect an empty string.
> >> Any idea what’s going on?
> >>
> >
> >
> >
> > --
> > Mark
> >
> >
> 
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu 
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> Mariano
> http://marianopeck.wordpress.com 


Re: [Pharo-users] Using OSSubProcess to invoke Java

2016-06-20 Thread Mariano Martinez Peck
On Mon, Jun 20, 2016 at 1:10 PM, Peter Uhnák  wrote:

> #runAndWaitOnExitDo: takes a cull-ed three-arg block with the process,
> stdout, and stderr; that way you can process stdout and stderr
> independently.
>
>
Exactly.


> Try this
>
> OSSUnixSubprocess new
>   command: '/usr/bin/java';
> arguments: #('-version');
> redirectStderr;
> runAndWaitOnExitDo: [ :process :out :err |
> err inspect
> ].
>


Indeed. This is what I think should work. And yes, I don't think the
'JAVA_HOME'  is needed. At least for this command.

Alex, let us know if Peter code worked.

Cheers,


>
> Peter
>
> On Mon, Jun 20, 2016 at 6:03 PM, Alexandre Bergel  > wrote:
>
>> Hi Mark,
>>
>> This is what I thought. But it does not seem to work. I tried:
>>
>> OSSUnixSubprocess new
>>   command: '/usr/bin/java';
>>   arguments: #('-version');
>> redirectStderr;
>>
>>   runAndWaitOnExitDo: [ :process :outString  |
>>   outString inspect
>>   ].
>>
>> Or is it the redirectStderr that does not work properly?
>>
>> Cheers,
>> Alexandre
>>
>>
>> > On Jun 20, 2016, at 11:42 AM, Mark Bestley  wrote:
>> >
>> > java -version outputs to stderr not stdout (also I don't think you need
>> JAVA_HOME /usr/bin/java will do what is needed)
>> >
>> >
>> >
>> > On 20/06/2016 15:58, Alexandre Bergel wrote:
>> >
>> >> On OS X, in a terminal, if I type: /usr/bin/java -version
>> >> I obtain:
>> >> java version "1.8.0_66"
>> >> Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
>> >> Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
>> >>
>> >> Using OSSubProcess, do-it-ing the following:
>> >>
>> >> OSSUnixSubprocess new
>> >>   command: '/usr/bin/java';
>> >>   arguments: #('-version');
>> >>  environmentAt: 'JAVA_HOME' put:
>> '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home';
>> >>  redirectStderr;
>> >>   redirectStdout;
>> >>   runAndWaitOnExitDo: [ :process :outString  |
>> >>   outString inspect
>> >>   ].
>> >>
>> >> inspect an empty string.
>> >> Any idea what’s going on?
>> >>
>> >
>> >
>> >
>> > --
>> > Mark
>> >
>> >
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>


-- 
Mariano
http://marianopeck.wordpress.com


Re: [Pharo-users] Using OSSubProcess to invoke Java

2016-06-20 Thread Peter Uhnák
#runAndWaitOnExitDo: takes a cull-ed three-arg block with the process,
stdout, and stderr; that way you can process stdout and stderr
independently.

Try this

OSSUnixSubprocess new
  command: '/usr/bin/java';
arguments: #('-version');
redirectStderr;
runAndWaitOnExitDo: [ :process :out :err |
err inspect
].

Peter

On Mon, Jun 20, 2016 at 6:03 PM, Alexandre Bergel 
wrote:

> Hi Mark,
>
> This is what I thought. But it does not seem to work. I tried:
>
> OSSUnixSubprocess new
>   command: '/usr/bin/java';
>   arguments: #('-version');
> redirectStderr;
>
>   runAndWaitOnExitDo: [ :process :outString  |
>   outString inspect
>   ].
>
> Or is it the redirectStderr that does not work properly?
>
> Cheers,
> Alexandre
>
>
> > On Jun 20, 2016, at 11:42 AM, Mark Bestley  wrote:
> >
> > java -version outputs to stderr not stdout (also I don't think you need
> JAVA_HOME /usr/bin/java will do what is needed)
> >
> >
> >
> > On 20/06/2016 15:58, Alexandre Bergel wrote:
> >
> >> On OS X, in a terminal, if I type: /usr/bin/java -version
> >> I obtain:
> >> java version "1.8.0_66"
> >> Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
> >> Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
> >>
> >> Using OSSubProcess, do-it-ing the following:
> >>
> >> OSSUnixSubprocess new
> >>   command: '/usr/bin/java';
> >>   arguments: #('-version');
> >>  environmentAt: 'JAVA_HOME' put:
> '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home';
> >>  redirectStderr;
> >>   redirectStdout;
> >>   runAndWaitOnExitDo: [ :process :outString  |
> >>   outString inspect
> >>   ].
> >>
> >> inspect an empty string.
> >> Any idea what’s going on?
> >>
> >
> >
> >
> > --
> > Mark
> >
> >
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>


Re: [Pharo-users] Using OSSubProcess to invoke Java

2016-06-20 Thread Alexandre Bergel
Hi Mark,

This is what I thought. But it does not seem to work. I tried:

OSSUnixSubprocess new
  command: '/usr/bin/java';
  arguments: #('-version');
redirectStderr;
 
  runAndWaitOnExitDo: [ :process :outString  |
  outString inspect
  ].

Or is it the redirectStderr that does not work properly?

Cheers,
Alexandre


> On Jun 20, 2016, at 11:42 AM, Mark Bestley  wrote:
> 
> java -version outputs to stderr not stdout (also I don't think you need 
> JAVA_HOME /usr/bin/java will do what is needed)
> 
> 
> 
> On 20/06/2016 15:58, Alexandre Bergel wrote:
> 
>> On OS X, in a terminal, if I type: /usr/bin/java -version
>> I obtain:
>> java version "1.8.0_66"
>> Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
>> Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)
>> 
>> Using OSSubProcess, do-it-ing the following:
>> 
>> OSSUnixSubprocess new
>>   command: '/usr/bin/java';
>>   arguments: #('-version');
>>  environmentAt: 'JAVA_HOME' put: 
>> '/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home';
>>  redirectStderr;
>>   redirectStdout;
>>   runAndWaitOnExitDo: [ :process :outString  |
>>   outString inspect
>>   ].
>> 
>> inspect an empty string.
>> Any idea what’s going on?
>> 
> 
> 
> 
> -- 
> Mark
> 
> 

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Re: [Pharo-users] Symbolic links in Pharo

2016-06-20 Thread Peter Uhnák
You can use FFI; just create an object with a method…

MyObject>>system: command
"Perform OS system() call."

^ self ffiCall: #(int system #(char * command)) module: LibC


And then you can do something like

MyObject new system: 'ln -s /tmp/source /tmp/target'

On Mon, Jun 20, 2016 at 5:57 PM, Thibault ARLOING <
thibault.arlo...@hotmail.fr> wrote:

> Yes, I know but I want to use only Pharo classes because I don't want to
> add a dependency to OSSubProcess in my program
>
>
> thanks anyway for your answer
>
>
> Thibault
>
>
> --
> *De :* Pharo-users  de la part de
> Hilaire 
> *Envoyé :* lundi 20 juin 2016 17:21
> *À :* pharo-users@lists.pharo.org
> *Objet :* Re: [Pharo-users] Symbolic links in Pharo
>
> I guess you can do it with OSSubProcess shell command
>
> Hilaire
> --
> Dr. Geo
> http://drgeo.eu
> GNU Dr. Geo, be a geometer! 
> drgeo.eu
> Be a Geometer! Dr. Geo, a software to design & manipulate interactive
> geometric sketches. It helps kids to explore geometry. Distributed with its
> source code it is ...
>
>
>
>


Re: [Pharo-users] Symbolic links in Pharo

2016-06-20 Thread Thibault ARLOING
Yes, I know but I want to use only Pharo classes because I don't want to add a 
dependency to OSSubProcess in my program


thanks anyway for your answer


Thibault



De : Pharo-users  de la part de Hilaire 

Envoyé : lundi 20 juin 2016 17:21
À : pharo-users@lists.pharo.org
Objet : Re: [Pharo-users] Symbolic links in Pharo

I guess you can do it with OSSubProcess shell command

Hilaire
--
Dr. Geo
http://drgeo.eu
GNU Dr. Geo, be a geometer!
drgeo.eu
Be a Geometer! Dr. Geo, a software to design & manipulate interactive geometric 
sketches. It helps kids to explore geometry. Distributed with its source code 
it is ...






Re: [Pharo-users] Using OSSubProcess to invoke Java

2016-06-20 Thread Mark Bestley
java -version outputs to stderr not stdout (also I don't think you need 
JAVA_HOME /usr/bin/java will do what is needed)




On 20/06/2016 15:58, Alexandre Bergel wrote:


On OS X, in a terminal, if I type: /usr/bin/java -version
I obtain:
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

Using OSSubProcess, do-it-ing the following:

OSSUnixSubprocess new
   command: '/usr/bin/java';
   arguments: #('-version');
environmentAt: 'JAVA_HOME' put: 
'/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home';
redirectStderr;
 redirectStdout;
   runAndWaitOnExitDo: [ :process :outString  |
   outString inspect
   ].

inspect an empty string.
Any idea what’s going on?





--
Mark




Re: [Pharo-users] Symbolic links in Pharo

2016-06-20 Thread Hilaire
I guess you can do it with OSSubProcess shell command

Hilaire
-- 
Dr. Geo
http://drgeo.eu




[Pharo-users] Dragging window only from its title

2016-06-20 Thread Hilaire
Hi,

Is it possible to drag a SystemWindow/StandardWindow ONLY from its
title, on the top?

Currently, the behaviour is: any area of the windows where there is no
widget behaves as a select point of the whole window.

For some young -- and older -- users of Dr.Geo it can be confusing.

I look at it but did not find obvious way to do it but hacking
#aboutToBeGrabbed: method.

Did I miss something?

Thanks

Hilaire

-- 
Dr. Geo
http://drgeo.eu




Re: [Pharo-users] Symbolic links in Pharo

2016-06-20 Thread Thibault ARLOING
Ok, I will create my symbolic links with a bash script until it is available in 
Pharo []


Thanks

Thibault



De : Pharo-users  de la part de Esteban 
Lorenzano 
Envoyé : lundi 20 juin 2016 16:51
À : Any question about pharo is welcome
Objet : Re: [Pharo-users] Symbolic links in Pharo

right now, you can’t… btw, even #isSymlink method is currently broken (I coded 
a replacement with UFFI but while making it work with linux I broke it with 
mac… and no time yet to finish it :( )
but I suppose also creating symlinks is something we can add soon :)

Esteban


On 20 Jun 2016, at 16:22, Thibault ARLOING 
> wrote:

Hi,

I want to create a symbolic link via Pharo.
But I don't know how, I found methods named #isSymlink but none for creation of 
symbolic links.

Can we create a symbolic link via Pharo ?

Thibault



[Pharo-users] Using OSSubProcess to invoke Java

2016-06-20 Thread Alexandre Bergel
Hi!

On OS X, in a terminal, if I type: /usr/bin/java -version 
I obtain:
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

Using OSSubProcess, do-it-ing the following:

OSSUnixSubprocess new
   command: '/usr/bin/java';
   arguments: #('-version');
environmentAt: 'JAVA_HOME' put: 
'/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home';
redirectStderr;
 redirectStdout;
   runAndWaitOnExitDo: [ :process :outString  |
   outString inspect
   ].

inspect an empty string.
Any idea what’s going on?

Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






Re: [Pharo-users] Symbolic links in Pharo

2016-06-20 Thread Esteban Lorenzano
right now, you can’t… btw, even #isSymlink method is currently broken (I coded 
a replacement with UFFI but while making it work with linux I broke it with 
mac… and no time yet to finish it :( )
but I suppose also creating symlinks is something we can add soon :)

Esteban


> On 20 Jun 2016, at 16:22, Thibault ARLOING  
> wrote:
> 
> Hi,
> 
> I want to create a symbolic link via Pharo.
> But I don't know how, I found methods named #isSymlink but none for creation 
> of symbolic links.
> 
> Can we create a symbolic link via Pharo ? 
> 
> Thibault



[Pharo-users] Symbolic links in Pharo

2016-06-20 Thread Thibault ARLOING
Hi,


I want to create a symbolic link via Pharo.

But I don't know how, I found methods named #isSymlink but none for creation of 
symbolic links.


Can we create a symbolic link via Pharo ?


Thibault


Re: [Pharo-users] #inform: Changed in 5.0?

2016-06-20 Thread Christophe Demarey
Hi Sean,

> Le 17 juin 2016 à 17:10, Sean P. DeNigris  a écrit :
> 
> During startup, I do `UIManager default inform: aString`. It used to show a
> Growl morph, but now opens a debugger. Did something change? If so, why and
> how do I circumvent the debugger? Thanks.

With the introduction of the session manager, error handling during startup 
actions was revisited.
You can check StartupUIManager>>#handleError:log: for errors coming before 
Morphic is initialized.
Once Morphic is initialized, you get a default UI manager (MorphicUIManager if 
in UI mode). It is managed by UIManagerSessionHandler class.

If your startup code is executed with StartupUIManager, it will add a deferred 
startup action to execute the inform, else it fallback to MorphicUIManager 
inform.
It should do the behavior you expect.

Could you give me more info (the stacktrace would be useful)? 

Cheers,
Christophe