Re: [wmii] Re: ruby wmiirc - interactive live demo

From: Suraj N. Kurapati <skurapat_AT_ucsc.edu>
Date: Sun, 17 Sep 2006 01:31:34 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Suraj N. Kurapati wrote:
> Constantine Evans wrote:
>>> As a very minor speed increase, have you considered replacing
>>> system("command &") with a function that does Process.fork {
>>> exec('command', [options')}? I'm not sure how much of an increase
>>> this would give, but it would prevent a shell from being started
>>> every time a new command is run. I've done this in my
>>> wmiirc-config.rb.
>
> Sweet! It does seem a bit faster now. Thanks for the tip.

Unfortunately, this does not seem to work for executables that are
not in the system path. For example, see this IRB session:

>> exec 'jedit'
Errno::ENOEXEC: Exec format error - jedit
        from (irb):8:in `exec'
        from (irb):8
        from :0

>> `which jedit`
=> "/home/sun/bin/jedit\n"

>> ENV['PATH'].squeeze(':').split(':').include? "/home/sun/bin"
=> true

Here, Kernel#exec does not seem to adhere to $PATH. Thus, we need
the help of a shell---which does adhere to $PATH.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFFDQfmmV9O7RYnKMcRAuBOAJ9K4RkiapjLfI0geFlhtQLnzR3shQCffXFC
DlKNI4rdLqgPmyt88JQRNHs=
=+xYK
-----END PGP SIGNATURE-----
Received on Sun Sep 17 2006 - 10:31:41 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 16:13:59 UTC