[squeak-dev] How to call irsend

David T. Lewis lewis at mail.msen.com
Tue Feb 5 22:22:50 UTC 2013


On Tue, Feb 05, 2013 at 03:55:14PM -0500, Louis LaBrunda wrote:
> 
> >On Mon, Feb 04, 2013 at 02:07:12PM -0500, Louis LaBrunda wrote:
> >> Hi Guys,
> >> 
> >> I would like to call irsend (a program that is part of lirc package) from
> >> Squeak on the Raspberry Pi.  Can anyone please post some sample code.
> >> 
> >
> >I'm not familiar with it myself, but if irsend is just a simple command line
> >program then I should think that you could call it easily using OSProcess.
> >
> 
> Thanks for the reply.  OSProcess sounds like it is what I need but I can't
> find any install instructions, probably because I don't know much about
> Squeak and Linux and I'm not sure where to look.
> 

Open a SqueakMap Package Loader:

  world -> open... -> SqueakMap Catalog

In the SqueakMap Package Loader, select package OSProcess. Expand that
category and you will find entries for version 4.4.11 and for "head".
Either one is fine, but I usually recommend just using the latest version,
so select "head" and install it.

Assuming that you want to run irsend with some command line parameters,
try inspecting the following expression (but use some command parameters
that actually do something):

  OSProcess command: 'irsend foo bar baz'

The result will be an instance of ExternalUnixOSProcess that is a proxy
for the actual irsend program that you just executed. You can send it
#succeeded to see if the command was evaluated without error.

I think this is sufficient for what you are trying to do, but you can also
do fancier things with external programs if you load CommandShell (also
on SqueakMap).

For additional background see http://wiki.squeak.org/squeak/708 and
http://wiki.squeak.org/squeak/1914.

Follow up questions welcome :)

Dave



More information about the Squeak-dev mailing list