OSProcess / OSSubprocess / LibC uniqueInstance

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

OSProcess / OSSubprocess / LibC uniqueInstance

Pharo Smalltalk Users mailing list

I need to execute OS commands from within a x64 pharo 7.01 image on centos7 (for example: 'zip -r 123.zip zipme/').

I found these 3 tools: OSProcess, OSSubprocess, LibC uniqueInstance

But I did not find any docu on which one to use for which use case.

  • OSProcess is in the catalog browser but fails loading because of ByteArray>>ifNotNilDo:
    -> So OSProcess is not to be used with p7 ?
  • OSSubprocess loads via catalog browser and the following snippet works (even though 64 bit):

OSSUnixSubprocess new
    command: 'zip';
    arguments: #('-r' '123.zip' 'zipme');
    redirectStdout;
    runAndWaitOnExitDo: [ :process :outString  |
        outString inspect
    ]

So is it ok to use OSSubprocess with 64 bit even though documented as 32 bit only ? (here: https://github.com/pharo-contributions/OSSubprocess#installation)

  • LibC uniqueInstance system: 'zip -r 123.zip zipme/'
    ... works, but I don't know if its the right tool for this.

Is there somewhere more info on which tool to use for which use case ?

Thanks in advance!

Albrecht

PS.: I need to use zip as os process only because of this issue: https://github.com/pharo-project/pharo/issues/2584

Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

David T. Lewis
On Tue, Feb 19, 2019 at 11:37:38AM +0100, Albrecht Baur via Pharo-users wrote:

> From: Albrecht Baur <[hidden email]>
> Subject: OSProcess / OSSubprocess / LibC uniqueInstance
> To: [hidden email]
> Date: Tue, 19 Feb 2019 11:37:38 +0100
>
> I need to execute OS commands from within a x64 pharo 7.01 image on
> centos7 (for example: 'zip -r 123.zip zipme/').
>
> I found these 3 tools: OSProcess, OSSubprocess, LibC uniqueInstance
>
> But I did not find any docu on which one to use for which use case.
>
>  * OSProcess is in the catalog browser but fails loading because of
>    ByteArray>>ifNotNilDo:
>    -> So OSProcess is not to be used with p7 ?

Hi Albrecht,

I am sorry that I cannot check it right now, but it may be that
ConfigurationOfOSProcess needs to be updated. The #ifNotNilDo: problem
was fixed by Thierry Goubier in July 2017, so perhaps you are using
an out of date version.

Hopefully someone else can give you a better answer, otherwise I will
try to follow up in a day or two.

Dave



>
>  * OSSubprocess loads via catalog browser and the following snippet
>    works (even though 64 bit):
>
> OSSUnixSubprocess new
> ?????? command: 'zip';
> ?????? arguments: #('-r' '123.zip' 'zipme');
> ?????? redirectStdout;
> ?????? runAndWaitOnExitDo: [ :process :outString?? |
> ?????? ?????? outString inspect
> ?????? ]
>
> So is it ok to use OSSubprocess with 64 bit even though documented as 32
> bit only ? (here:
> https://github.com/pharo-contributions/OSSubprocess#installation)
>
>  * LibC uniqueInstance system: 'zip -r 123.zip zipme/'
>    ... works, but I don't know if its the right tool for this.
>
> Is there somewhere more info on which tool to use for which use case ?
>
> Thanks in advance!
>
> Albrecht
>
> PS.: I need to use zip as os process only because of this issue:
> https://github.com/pharo-project/pharo/issues/2584
>

Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

SergeStinckwich


On Tue, Feb 19, 2019 at 11:56 AM David T. Lewis <[hidden email]> wrote:
On Tue, Feb 19, 2019 at 11:37:38AM +0100, Albrecht Baur via Pharo-users wrote:
> From: Albrecht Baur <[hidden email]>
> Subject: OSProcess / OSSubprocess / LibC uniqueInstance
> To: [hidden email]
> Date: Tue, 19 Feb 2019 11:37:38 +0100
>
> I need to execute OS commands from within a x64 pharo 7.01 image on
> centos7 (for example: 'zip -r 123.zip zipme/').
>
> I found these 3 tools: OSProcess, OSSubprocess, LibC uniqueInstance
>
> But I did not find any docu on which one to use for which use case.
>
>  * OSProcess is in the catalog browser but fails loading because of
>    ByteArray>>ifNotNilDo:
>    -> So OSProcess is not to be used with p7 ?

Hi Albrecht,

I am sorry that I cannot check it right now, but it may be that
ConfigurationOfOSProcess needs to be updated. The #ifNotNilDo: problem
was fixed by Thierry Goubier in July 2017, so perhaps you are using
an out of date version.

Hopefully someone else can give you a better answer, otherwise I will
try to follow up in a day or two.


I have the same problem of ifNotNilDo: when I load OSProcess in Pharo 7.
What version do you use ?
Regards,

--
Serge Stinckwic
h

Int. Research Unit
 on Modelling/Simulation of Complex Systems (UMMISCO)
Sorbonne University
 (SU)
French National Research Institute for Sustainable Development (IRD)
U
niversity of Yaoundé I, Cameroun
"Programs must be written for people to read, and only incidentally for machines to execute."
https://twitter.com/SergeStinckwich
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

Pharo Smalltalk Users mailing list

I just tried the easy way via catalog browser.

I think it is OSProcess 4.6.9 from http://www.squeaksource.com/OSProcess

On 19.02.19 12:01, Serge Stinckwich wrote:


On Tue, Feb 19, 2019 at 11:56 AM David T. Lewis <[hidden email]> wrote:
On Tue, Feb 19, 2019 at 11:37:38AM +0100, Albrecht Baur via Pharo-users wrote:
> From: Albrecht Baur <[hidden email]>
> Subject: OSProcess / OSSubprocess / LibC uniqueInstance
> To: [hidden email]
> Date: Tue, 19 Feb 2019 11:37:38 +0100
>
> I need to execute OS commands from within a x64 pharo 7.01 image on
> centos7 (for example: 'zip -r 123.zip zipme/').
>
> I found these 3 tools: OSProcess, OSSubprocess, LibC uniqueInstance
>
> But I did not find any docu on which one to use for which use case.
>
>  * OSProcess is in the catalog browser but fails loading because of
>    ByteArray>>ifNotNilDo:
>    -> So OSProcess is not to be used with p7 ?

Hi Albrecht,

I am sorry that I cannot check it right now, but it may be that
ConfigurationOfOSProcess needs to be updated. The #ifNotNilDo: problem
was fixed by Thierry Goubier in July 2017, so perhaps you are using
an out of date version.

Hopefully someone else can give you a better answer, otherwise I will
try to follow up in a day or two.


I have the same problem of ifNotNilDo: when I load OSProcess in Pharo 7.
What version do you use ?
Regards,

--
Serge Stinckwic
h

Int. Research Unit
 on Modelling/Simulation of Complex Systems (UMMISCO)
Sorbonne University
 (SU)
French National Research Institute for Sustainable Development (IRD)
U
niversity of Yaoundé I, Cameroun
"Programs must be written for people to read, and only incidentally for machines to execute."
https://twitter.com/SergeStinckwich
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

Thierry Goubier
In reply to this post by Pharo Smalltalk Users mailing list
Hi Serge, Albrecht,

loading OSProcess directly with the following expression works:

Metacello new
    configuration: 'OSProcess';
    repository: 'http://www.squeaksource.com/MetacelloRepository';
    load

There is still some work to be done on OSProcess adaptation to Pharo
7, but they are in rarely used parts.

Regards,

Thierry

Le mar. 19 févr. 2019 à 12:19, Albrecht Baur via Pharo-users
<[hidden email]> a écrit :

>
> I need to execute OS commands from within a x64 pharo 7.01 image on centos7 (for example: 'zip -r 123.zip zipme/').
>
> I found these 3 tools: OSProcess, OSSubprocess, LibC uniqueInstance
>
> But I did not find any docu on which one to use for which use case.
>
> OSProcess is in the catalog browser but fails loading because of ByteArray>>ifNotNilDo:
> -> So OSProcess is not to be used with p7 ?
>
> OSSubprocess loads via catalog browser and the following snippet works (even though 64 bit):
>
> OSSUnixSubprocess new
>     command: 'zip';
>     arguments: #('-r' '123.zip' 'zipme');
>     redirectStdout;
>     runAndWaitOnExitDo: [ :process :outString  |
>         outString inspect
>     ]
>
> So is it ok to use OSSubprocess with 64 bit even though documented as 32 bit only ? (here: https://github.com/pharo-contributions/OSSubprocess#installation)
>
> LibC uniqueInstance system: 'zip -r 123.zip zipme/'
> ... works, but I don't know if its the right tool for this.
>
> Is there somewhere more info on which tool to use for which use case ?
>
> Thanks in advance!
>
> Albrecht
>
> PS.: I need to use zip as os process only because of this issue: https://github.com/pharo-project/pharo/issues/2584

Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

SergeStinckwich
Thank you Thierry.

On Tue, Feb 19, 2019 at 12:48 PM Thierry Goubier <[hidden email]> wrote:
Hi Serge, Albrecht,

loading OSProcess directly with the following expression works:

Metacello new
    configuration: 'OSProcess';
    repository: 'http://www.squeaksource.com/MetacelloRepository';
    load

There is still some work to be done on OSProcess adaptation to Pharo
7, but they are in rarely used parts.

Regards,

Thierry

Le mar. 19 févr. 2019 à 12:19, Albrecht Baur via Pharo-users
<[hidden email]> a écrit :
>
> I need to execute OS commands from within a x64 pharo 7.01 image on centos7 (for example: 'zip -r 123.zip zipme/').
>
> I found these 3 tools: OSProcess, OSSubprocess, LibC uniqueInstance
>
> But I did not find any docu on which one to use for which use case.
>
> OSProcess is in the catalog browser but fails loading because of ByteArray>>ifNotNilDo:
> -> So OSProcess is not to be used with p7 ?
>
> OSSubprocess loads via catalog browser and the following snippet works (even though 64 bit):
>
> OSSUnixSubprocess new
>     command: 'zip';
>     arguments: #('-r' '123.zip' 'zipme');
>     redirectStdout;
>     runAndWaitOnExitDo: [ :process :outString  |
>         outString inspect
>     ]
>
> So is it ok to use OSSubprocess with 64 bit even though documented as 32 bit only ? (here: https://github.com/pharo-contributions/OSSubprocess#installation)
>
> LibC uniqueInstance system: 'zip -r 123.zip zipme/'
> ... works, but I don't know if its the right tool for this.
>
> Is there somewhere more info on which tool to use for which use case ?
>
> Thanks in advance!
>
> Albrecht
>
> PS.: I need to use zip as os process only because of this issue: https://github.com/pharo-project/pharo/issues/2584



--
Serge Stinckwic
​h​

Int. Research Unit
 on Modelling/Simulation of Complex Systems (UMMISCO)
​Sorbonne University
 (SU)
French National Research Institute for Sustainable Development (IRD)​
U
​niversity of Yaoundé I​, Cameroun
"Programs must be written for people to read, and only incidentally for machines to execute."
https://twitter.com/SergeStinckwich
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

Pharo Smalltalk Users mailing list

Thank you.

The Metacello snippet helps. It loads a newer version than that from the catalog browser.


But 2 more questions:

1.: Is there a reason not to use just ...

LibC uniqueInstance system: 'zip -r 123.zip zipme/'

... ?

And 2.: Is it ok to use OSSubprocess on in 64 bit images even though the documentation says it doesn't work ? (but it does)

-> https://github.com/pharo-contributions/OSSubprocess#installation


On 19.02.19 13:05, Serge Stinckwich wrote:
Thank you Thierry.

On Tue, Feb 19, 2019 at 12:48 PM Thierry Goubier <[hidden email]> wrote:
Hi Serge, Albrecht,

loading OSProcess directly with the following expression works:

Metacello new
    configuration: 'OSProcess';
    repository: 'http://www.squeaksource.com/MetacelloRepository';
    load

There is still some work to be done on OSProcess adaptation to Pharo
7, but they are in rarely used parts.

Regards,

Thierry

Le mar. 19 févr. 2019 à 12:19, Albrecht Baur via Pharo-users
<[hidden email]> a écrit :
>
> I need to execute OS commands from within a x64 pharo 7.01 image on centos7 (for example: 'zip -r 123.zip zipme/').
>
> I found these 3 tools: OSProcess, OSSubprocess, LibC uniqueInstance
>
> But I did not find any docu on which one to use for which use case.
>
> OSProcess is in the catalog browser but fails loading because of ByteArray>>ifNotNilDo:
> -> So OSProcess is not to be used with p7 ?
>
> OSSubprocess loads via catalog browser and the following snippet works (even though 64 bit):
>
> OSSUnixSubprocess new
>     command: 'zip';
>     arguments: #('-r' '123.zip' 'zipme');
>     redirectStdout;
>     runAndWaitOnExitDo: [ :process :outString  |
>         outString inspect
>     ]
>
> So is it ok to use OSSubprocess with 64 bit even though documented as 32 bit only ? (here: https://github.com/pharo-contributions/OSSubprocess#installation)
>
> LibC uniqueInstance system: 'zip -r 123.zip zipme/'
> ... works, but I don't know if its the right tool for this.
>
> Is there somewhere more info on which tool to use for which use case ?
>
> Thanks in advance!
>
> Albrecht
>
> PS.: I need to use zip as os process only because of this issue: https://github.com/pharo-project/pharo/issues/2584



--
Serge Stinckwic
​h​

Int. Research Unit
 on Modelling/Simulation of Complex Systems (UMMISCO)
​Sorbonne University
 (SU)
French National Research Institute for Sustainable Development (IRD)​
U
​niversity of Yaoundé I​, Cameroun
"Programs must be written for people to read, and only incidentally for machines to execute."
https://twitter.com/SergeStinckwich
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

alistairgrant
On Tue, 19 Feb 2019 at 13:45, Albrecht Baur via Pharo-users
<[hidden email]> wrote:

>
> Thank you.
>
> The Metacello snippet helps. It loads a newer version than that from the catalog browser.
>
>
> But 2 more questions:
>
> 1.: Is there a reason not to use just ...
>
> LibC uniqueInstance system: 'zip -r 123.zip zipme/'

You don't have the same level of control over the process, can't pipe
stdio, it introduces issues with interrupts (SIGINT, SIGQUIT), etc.


> And 2.: Is it ok to use OSSubprocess on in 64 bit images even though the documentation says it doesn't work ? (but it does)
>
> -> https://github.com/pharo-contributions/OSSubprocess#installation

That's a surprise.  Yes, OSSubprocess is officially supported on 64
bits, the readme is out of date.

HTH,
Alistair

Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

Mariano Martinez Peck
Yeah, readme is out of date. 64 bits is working: https://github.com/pharo-contributions/OSSubprocess/issues/22

On Tue, Feb 19, 2019 at 4:48 PM Alistair Grant <[hidden email]> wrote:
On Tue, 19 Feb 2019 at 13:45, Albrecht Baur via Pharo-users
<[hidden email]> wrote:
>
> Thank you.
>
> The Metacello snippet helps. It loads a newer version than that from the catalog browser.
>
>
> But 2 more questions:
>
> 1.: Is there a reason not to use just ...
>
> LibC uniqueInstance system: 'zip -r 123.zip zipme/'

You don't have the same level of control over the process, can't pipe
stdio, it introduces issues with interrupts (SIGINT, SIGQUIT), etc.


> And 2.: Is it ok to use OSSubprocess on in 64 bit images even though the documentation says it doesn't work ? (but it does)
>
> -> https://github.com/pharo-contributions/OSSubprocess#installation

That's a surprise.  Yes, OSSubprocess is officially supported on 64
bits, the readme is out of date.

HTH,
Alistair



--
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess / OSSubprocess / LibC uniqueInstance

Pharo Smalltalk Users mailing list

Nice! This helps -> thanks for the explanation.

Albrecht

On 19.02.19 21:10, Mariano Martinez Peck wrote:
Yeah, readme is out of date. 64 bits is working: https://github.com/pharo-contributions/OSSubprocess/issues/22

On Tue, Feb 19, 2019 at 4:48 PM Alistair Grant <[hidden email]> wrote:
On Tue, 19 Feb 2019 at 13:45, Albrecht Baur via Pharo-users
<[hidden email]> wrote:
>
> Thank you.
>
> The Metacello snippet helps. It loads a newer version than that from the catalog browser.
>
>
> But 2 more questions:
>
> 1.: Is there a reason not to use just ...
>
> LibC uniqueInstance system: 'zip -r 123.zip zipme/'

You don't have the same level of control over the process, can't pipe
stdio, it introduces issues with interrupts (SIGINT, SIGQUIT), etc.


> And 2.: Is it ok to use OSSubprocess on in 64 bit images even though the documentation says it doesn't work ? (but it does)
>
> -> https://github.com/pharo-contributions/OSSubprocess#installation

That's a surprise.  Yes, OSSubprocess is officially supported on 64
bits, the readme is out of date.

HTH,
Alistair



--