Launch an external application from visual works

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

Launch an external application from visual works

atomikx
Hi,

I would like to know how I could launch an external application (an executable) in smalltalk from visual works ?

Thankx a lot !

atomikx
Reply | Threaded
Open this post in threaded view
|

AW: Launch an external application from visual works

Nowak, Helge
look at
UnixProcess cshOne:
WinProcess cshOne:

respectively

HTH
Helge

-----Ursprüngliche Nachricht-----
Von: atomikx [mailto:[hidden email]]
Gesendet: Donnerstag, 23. August 2007 13:51
An: [hidden email]
Betreff: Launch an external application from visual works


Hi,

I would like to know how I could launch an external application (an
executable) in smalltalk from visual works ?

Thankx a lot !

atomikx
--
View this message in context: http://www.nabble.com/Launch-an-external-application-from-visual-works-tf4317083.html#a12292141
Sent from the VisualWorks mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: AW: Launch an external application from visual works

Mark Pirogovsky-3
In addition  you can start an application via opening well know file types.

Load parcel "Windows Godies" and  do the following:

MinimalShellInterface openFile: 'xyz.pdf'  from:Dialog defaultParentWindow.

it will open Adobe reader in this example.

If you use file as: 'http://yahoo.com' it will open default browser.

HTH

--Mark


Nowak, Helge wrote:

> look at
> UnixProcess cshOne:
> WinProcess cshOne:
>
> respectively
>
> HTH
> Helge
>
> -----Ursprüngliche Nachricht-----
> Von: atomikx [mailto:[hidden email]]
> Gesendet: Donnerstag, 23. August 2007 13:51
> An: [hidden email]
> Betreff: Launch an external application from visual works
>
>
> Hi,
>
> I would like to know how I could launch an external application (an
> executable) in smalltalk from visual works ?
>
> Thankx a lot !
>
> atomikx
> --
> View this message in context: http://www.nabble.com/Launch-an-external-application-from-visual-works-tf4317083.html#a12292141
> Sent from the VisualWorks mailing list archive at Nabble.com.
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: AW: Launch an external application from visual works -->>>So what about file Icons

Maarten Mostert-2
Hi,

The windows goodies seem to be able to do quite a number of things. Now
what about obtaining the platform file icons in readable graphics format
to show these in a list ?

Do you know about away to obtain these ?

Thanks,
 
@+Maarten,


Mark Pirogovsky a écrit :

> In addition  you can start an application via opening well know file
> types.
>
> Load parcel "Windows Godies" and  do the following:
>
> MinimalShellInterface openFile: 'xyz.pdf'  from:Dialog
> defaultParentWindow.
>
> it will open Adobe reader in this example.
>
> If you use file as: 'http://yahoo.com' it will open default browser.
>
> HTH
>
> --Mark
>
>
> Nowak, Helge wrote:
>> look at
>> UnixProcess cshOne:
>> WinProcess cshOne:
>>
>> respectively
>>
>> HTH
>> Helge
>>
>> -----Ursprüngliche Nachricht-----
>> Von: atomikx [mailto:[hidden email]] Gesendet: Donnerstag, 23.
>> August 2007 13:51
>> An: [hidden email]
>> Betreff: Launch an external application from visual works
>>
>>
>> Hi,
>>
>> I would like to know how I could launch an external application (an
>> executable) in smalltalk from visual works ?
>>
>> Thankx a lot !
>>
>> atomikx
>> --
>> View this message in context:
>> http://www.nabble.com/Launch-an-external-application-from-visual-works-tf4317083.html#a12292141 
>>
>> Sent from the VisualWorks mailing list archive at Nabble.com.
>>
>>
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Using ExternalProcess?

Carl Gundel
ExternalProcess defaultClass cshOne: 'some command'

The cshOne: method is very cool for single shot commands, but how would I
use ExternalProcess with an interactive program like mail or ftp?

Also, is this functionality effectively the same for Windows and Unix?  My
guess is that Windows doesn't support piping in the same way as Unix.

-Carl Gundel
http://www.runbasic.com 


Reply | Threaded
Open this post in threaded view
|

AW: Using ExternalProcess?

Georg Heeg
Carl,

WinProcess supports piping. Technically opens a cmd.com and talks to
programs like ftp and whatever you have.

Georg

Georg Heeg eK, Dortmund und Köthen, HR Dortmund A 12812
Tel. +49-3496-214328, Fax +49-3496-214712

> -----Ursprüngliche Nachricht-----
> Von: Carl Gundel [mailto:[hidden email]]
> Gesendet: Donnerstag, 23. August 2007 19:49
> An: [hidden email]
> Betreff: Using ExternalProcess?
>
> ExternalProcess defaultClass cshOne: 'some command'
>
> The cshOne: method is very cool for single shot commands, but how would I
> use ExternalProcess with an interactive program like mail or ftp?
>
> Also, is this functionality effectively the same for Windows and Unix?  My
> guess is that Windows doesn't support piping in the same way as Unix.
>
> -Carl Gundel
> http://www.runbasic.com
>


Reply | Threaded
Open this post in threaded view
|

Re: Using ExternalProcess?

Cesar Rabak
In reply to this post by Carl Gundel
Carl Gundel escreveu:
> ExternalProcess defaultClass cshOne: 'some command'
>
> The cshOne: method is very cool for single shot commands, but how would
> I use ExternalProcess with an interactive program like mail or ftp?
>
> Also, is this functionality effectively the same for Windows and Unix?  
> My guess is that Windows doesn't support piping in the same way as Unix.
>
Carl,

What do you mean with "interactive program"? Do you want start an
external programm and keep getting data to/from it?

--
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/

Reply | Threaded
Open this post in threaded view
|

Re: Using ExternalProcess?

Michael Lucas-Smith-2
In reply to this post by Carl Gundel
Carl Gundel wrote:
> ExternalProcess defaultClass cshOne: 'some command'
>
> The cshOne: method is very cool for single shot commands, but how
> would I use ExternalProcess with an interactive program like mail or ftp?
Try External-Process-Streams - this strips away the need to use the
command shell to do piping in/out of applications. So it works on
Windows like it does on Unix - it has a common API across all platforms.

Reply | Threaded
Open this post in threaded view
|

Re: Using ExternalProcess?

Carl Gundel
In reply to this post by Carl Gundel
Hey Cesar,

I am trying to create a generic mechanism for my web programming platform
Run BASIC so that the programmer can interact with external programs.  These
could be FTP, MAIL, or some custom scripts written in Perl, etc.  I would
like to use ExternalProcess for this.  So far I have not managed to make it
work.

So far I've been experimenting in a workspace trying to interact with FTP
from the command line.  I've tried various combinations of executeCommand:,
executeSingleCommand:, readPipe, readFromPipe, and writePipe:.  So far all
I've managed to do is hang.  Ctrl+Y sometimes recovers.  When it does, that
instance of WinProcess is now useless.

Also, it seems strange that UnixProcess and WinProcess both inherit from
ExternalProcess but there is no shared protocol between the two.  :-/

-Carl Gundel
http://www.runbasic.com

----- Original Message -----
From: "Cesar Rabak" <[hidden email]>
To: <[hidden email]>
Cc: <[hidden email]>
Sent: Thursday, August 23, 2007 2:17 PM
Subject: Re: Using ExternalProcess?


> Carl Gundel escreveu:
>> ExternalProcess defaultClass cshOne: 'some command'
>>
>> The cshOne: method is very cool for single shot commands, but how would I
>> use ExternalProcess with an interactive program like mail or ftp?
>>
>> Also, is this functionality effectively the same for Windows and Unix? My
>> guess is that Windows doesn't support piping in the same way as Unix.
>>
> Carl,
>
> What do you mean with "interactive program"? Do you want start an external
> programm and keep getting data to/from it?
>
> --
> Cesar Rabak
> GNU/Linux User 52247.
> Get counted: http://counter.li.org/
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Using ExternalProcess?

Carl Gundel
In reply to this post by Michael Lucas-Smith-2
> Carl Gundel wrote:
>> ExternalProcess defaultClass cshOne: 'some command'
>>
>> The cshOne: method is very cool for single shot commands, but how would I
>> use ExternalProcess with an interactive program like mail or ftp?
> Try External-Process-Streams - this strips away the need to use the
> command shell to do piping in/out of applications. So it works on Windows
> like it does on Unix - it has a common API across all platforms.

Thanks Michael.  I loaded the latest version of this from the public Store
and there are only a few instance methods in the new WindowsProcess class:

bufferSize
getStatusCode
initialize
kill
kill:

I'm not sure how I would use this new class to do what I need.  Any ideas?

-Carl Gundel
http://www.runbasic.com



Reply | Threaded
Open this post in threaded view
|

Re: Using ExternalProcess?

Michael Lucas-Smith-2
Carl Gundel wrote:

>> Carl Gundel wrote:
>>> ExternalProcess defaultClass cshOne: 'some command'
>>>
>>> The cshOne: method is very cool for single shot commands, but how
>>> would I use ExternalProcess with an interactive program like mail or
>>> ftp?
>> Try External-Process-Streams - this strips away the need to use the
>> command shell to do piping in/out of applications. So it works on
>> Windows like it does on Unix - it has a common API across all platforms.
>
> Thanks Michael.  I loaded the latest version of this from the public
> Store and there are only a few instance methods in the new
> WindowsProcess class:
>
> bufferSize
> getStatusCode
> initialize
> kill
> kill:
>
> I'm not sure how I would use this new class to do what I need.  Any
> ideas?
>
Heh - as the package comment says:

ExternalProcess execute: command arguments: arguments do: [:readStream
:writeStream | ] errorStreamDo: [:errorStream | ].

eg:

ExternalProcess execute: 'irb' arguments: '-i' do:
    [:readStream :writeStream |
    writeStream nextPutAll: '1 + 2'; cr.
    readStream upToEnd inspect]
    errorStream: [:errorStream | self error: errorStream upToEnd].


Reply | Threaded
Open this post in threaded view
|

RE: Using ExternalProcess?

Daniel Klein-4
In reply to this post by Michael Lucas-Smith-2
I went looking for this cos I have a need for it too. Are 'External',
'Process', 'Streams' packages, bundles, classes, ???.

Where is it?

Daniel Klein


-----Original Message-----
From: Michael Lucas-Smith [mailto:[hidden email]]
Sent: Thursday, August 23, 2007 3:04 PM
To: Carl Gundel
Cc: [hidden email]
Subject: Re: Using ExternalProcess?

Carl Gundel wrote:
> ExternalProcess defaultClass cshOne: 'some command'
>
> The cshOne: method is very cool for single shot commands, but how
> would I use ExternalProcess with an interactive program like mail or ftp?
Try External-Process-Streams - this strips away the need to use the
command shell to do piping in/out of applications. So it works on
Windows like it does on Unix - it has a common API across all platforms.


Reply | Threaded
Open this post in threaded view
|

Re: Using ExternalProcess?

Michael Lucas-Smith-2
ExternalProcessStreams is a package in public store.

I've had previous reports of situations where using the API in this
package fails. If you try it and you do have a failure - please post it
back to this thread.

Michael


Daniel Klein wrote:

> I went looking for this cos I have a need for it too. Are 'External',
> 'Process', 'Streams' packages, bundles, classes, ???.
>
> Where is it?
>
> Daniel Klein
>
>
> -----Original Message-----
> From: Michael Lucas-Smith [mailto:[hidden email]]
> Sent: Thursday, August 23, 2007 3:04 PM
> To: Carl Gundel
> Cc: [hidden email]
> Subject: Re: Using ExternalProcess?
>
> Carl Gundel wrote:
>  
>> ExternalProcess defaultClass cshOne: 'some command'
>>
>> The cshOne: method is very cool for single shot commands, but how
>> would I use ExternalProcess with an interactive program like mail or ftp?
>>    
> Try External-Process-Streams - this strips away the need to use the
> command shell to do piping in/out of applications. So it works on
> Windows like it does on Unix - it has a common API across all platforms.
>
>
>
>  

Reply | Threaded
Open this post in threaded view
|

FixedPoint comment -- "Object Reference" info

Cesar Rabak
In reply to this post by Daniel Klein-4
After reading a recent thread in c.l.smalltalk, I got curious about this
class.

I think we have some leftover from earlier versions:

<quote>
Object Reference:
FixedPoint numbers are typically used in business applications, for
monetary amounts and similar quantities that require a fixed number of
digits after the decimal point, as well as an unlimited number of digits
before the decimal point. In contrast, a floating point number (Float or
Double) is awkward for business usage because its precision is limited
and the number of post-decimal digits varies.
A FixedPoint number is typically created by sending an #asFixedPoint:
message to a different kind of number, such as a Float, with the number
of post-decimal digits as the argument. For example:
        (200 / 3) asFixedPoint: 2 = 66.67f
A FixedPoint can also be written literally, by placing the letter 'f'
after an integer or floating point number.
</quote>

Now in the workspace:

66.67s class returns "FixedPoint"

However:

66.67f class raises the exception MNU: #f

HTH

--
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/

Reply | Threaded
Open this post in threaded view
|

Re: FixedPoint comment -- "Object Reference" info

Dennis smith-4
Looks like just a typo to me -- I don't ever remember 'f' being used to
create fixedPoint.  If anything,
I would expect it to create float, as '66.67d' would create double, but
I think it just needs to be chagned to 's'.

Cesar Rabak wrote:

> After reading a recent thread in c.l.smalltalk, I got curious about
> this class.
>
> I think we have some leftover from earlier versions:
>
> <quote>
> Object Reference:
> FixedPoint numbers are typically used in business applications, for
> monetary amounts and similar quantities that require a fixed number of
> digits after the decimal point, as well as an unlimited number of
> digits before the decimal point. In contrast, a floating point number
> (Float or Double) is awkward for business usage because its precision
> is limited and the number of post-decimal digits varies.
> A FixedPoint number is typically created by sending an #asFixedPoint:
> message to a different kind of number, such as a Float, with the
> number of post-decimal digits as the argument. For example:
>     (200 / 3) asFixedPoint: 2 = 66.67f
> A FixedPoint can also be written literally, by placing the letter 'f'
> after an integer or floating point number.
> </quote>
>
> Now in the workspace:
>
> 66.67s class returns "FixedPoint"
>
> However:
>
> 66.67f class raises the exception MNU: #f
>
> HTH
>

--
Dennis Smith                         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

Reply | Threaded
Open this post in threaded view
|

RE: Using ExternalProcess?

Daniel Klein-4
In reply to this post by Michael Lucas-Smith-2
Please excuse my inexperience but where is the 'public store' ?

Daniel Klein

-----Original Message-----
From: Michael Lucas-Smith [mailto:[hidden email]]
Sent: Friday, August 24, 2007 8:31 AM
To: Daniel Klein
Cc: [hidden email]
Subject: Re: Using ExternalProcess?

ExternalProcessStreams is a package in public store.

I've had previous reports of situations where using the API in this
package fails. If you try it and you do have a failure - please post it
back to this thread.

Michael


Daniel Klein wrote:

> I went looking for this cos I have a need for it too. Are 'External',
> 'Process', 'Streams' packages, bundles, classes, ???.
>
> Where is it?
>
> Daniel Klein
>
>
> -----Original Message-----
> From: Michael Lucas-Smith [mailto:[hidden email]]
> Sent: Thursday, August 23, 2007 3:04 PM
> To: Carl Gundel
> Cc: [hidden email]
> Subject: Re: Using ExternalProcess?
>
> Carl Gundel wrote:
>  
>> ExternalProcess defaultClass cshOne: 'some command'
>>
>> The cshOne: method is very cool for single shot commands, but how
>> would I use ExternalProcess with an interactive program like mail or ftp?
>>    
> Try External-Process-Streams - this strips away the need to use the
> command shell to do piping in/out of applications. So it works on
> Windows like it does on Unix - it has a common API across all platforms.
>
>
>
>  


Reply | Threaded
Open this post in threaded view
|

AW: Using ExternalProcess?

Nowak, Helge
http://www.cincomsmalltalk.com/CincomSmalltalkWiki/PostgreSQL+Access+Page 

-----Ursprüngliche Nachricht-----
Von: Daniel Klein [mailto:[hidden email]]
Gesendet: Freitag, 24. August 2007 17:12
An: [hidden email]
Betreff: RE: Using ExternalProcess?

Please excuse my inexperience but where is the 'public store' ?

Daniel Klein

-----Original Message-----
From: Michael Lucas-Smith [mailto:[hidden email]]
Sent: Friday, August 24, 2007 8:31 AM
To: Daniel Klein
Cc: [hidden email]
Subject: Re: Using ExternalProcess?

ExternalProcessStreams is a package in public store.

I've had previous reports of situations where using the API in this package fails. If you try it and you do have a failure - please post it back to this thread.

Michael


Daniel Klein wrote:

> I went looking for this cos I have a need for it too. Are 'External',
> 'Process', 'Streams' packages, bundles, classes, ???.
>
> Where is it?
>
> Daniel Klein
>
>
> -----Original Message-----
> From: Michael Lucas-Smith [mailto:[hidden email]]
> Sent: Thursday, August 23, 2007 3:04 PM
> To: Carl Gundel
> Cc: [hidden email]
> Subject: Re: Using ExternalProcess?
>
> Carl Gundel wrote:
>  
>> ExternalProcess defaultClass cshOne: 'some command'
>>
>> The cshOne: method is very cool for single shot commands, but how
>> would I use ExternalProcess with an interactive program like mail or ftp?
>>    
> Try External-Process-Streams - this strips away the need to use the
> command shell to do piping in/out of applications. So it works on
> Windows like it does on Unix - it has a common API across all platforms.
>
>
>
>  


Reply | Threaded
Open this post in threaded view
|

RE: Using ExternalProcess?

Terry Raymond
In reply to this post by Daniel Klein-4
Daniel

http://www.cincomsmalltalk.com/CincomSmalltalkWiki/Public+Store+Repository

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: Daniel Klein [mailto:[hidden email]]
> Sent: Friday, August 24, 2007 11:12 AM
> To: [hidden email]
> Subject: RE: Using ExternalProcess?
>
> Please excuse my inexperience but where is the 'public store' ?
>
> Daniel Klein
>
> -----Original Message-----
> From: Michael Lucas-Smith [mailto:[hidden email]]
> Sent: Friday, August 24, 2007 8:31 AM
> To: Daniel Klein
> Cc: [hidden email]
> Subject: Re: Using ExternalProcess?
>
> ExternalProcessStreams is a package in public store.
>
> I've had previous reports of situations where using the API in this
> package fails. If you try it and you do have a failure - please post it
> back to this thread.
>
> Michael
>
>
> Daniel Klein wrote:
> > I went looking for this cos I have a need for it too. Are 'External',
> > 'Process', 'Streams' packages, bundles, classes, ???.
> >
> > Where is it?
> >
> > Daniel Klein
> >
> >
> > -----Original Message-----
> > From: Michael Lucas-Smith [mailto:[hidden email]]
> > Sent: Thursday, August 23, 2007 3:04 PM
> > To: Carl Gundel
> > Cc: [hidden email]
> > Subject: Re: Using ExternalProcess?
> >
> > Carl Gundel wrote:
> >
> >> ExternalProcess defaultClass cshOne: 'some command'
> >>
> >> The cshOne: method is very cool for single shot commands, but how
> >> would I use ExternalProcess with an interactive program like mail or
> ftp?
> >>
> > Try External-Process-Streams - this strips away the need to use the
> > command shell to do piping in/out of applications. So it works on
> > Windows like it does on Unix - it has a common API across all platforms.
> >
> >
> >
> >


Reply | Threaded
Open this post in threaded view
|

Re: FixedPoint comment -- "Object Reference" info

Cesar Rabak
In reply to this post by Dennis smith-4
Dennis Smith escreveu:
 > Looks like just a typo to me -- I don't ever remember 'f' being used to
 > create fixedPoint.  If anything,
 > I would expect it to create float, as '66.67d' would create double, but
 > I think it just needs to be chagned to 's'.

Yes. My impression as well. Albeit 'f' does not mean float either.

Is a minor typo which in due time (release) could be taken care of.

Regards,



--
Cesar Rabak
GNU/Linux User 52247.
Get counted: http://counter.li.org/

Reply | Threaded
Open this post in threaded view
|

Re: FixedPoint comment -- "Object Reference" info

Mark Roberts
Thank you. I've created AR 52774 to resolve this.

M

123