-----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-----
_______________________________________________
[email protected] mailing list
http://wmii.de/cgi-bin/mailman/listinfo/wmii