[Alsaplayer-devel]python interface plugin

Evgeny Chukreev codedj@echo.ru
Sun, 14 Apr 2002 06:26:18 +0700


On Sat, 13 Apr 2002 20:22:15 +0200, Andy Lo A Foe <andy@alsaplayer.org> wrote:

ALAF> > so what about to fix code which i have talked about?
ALAF> > I am trying to proof that argv[0] may has path + name instead of name
ALAF> > only.
ALAF> With exec*() you can always do the right thing by passing the needed
ALAF> command line interface right in the argv array, so fixing the argv[0]
ALAF> scanning is IMHO not really needed. The idea of this hack was really to
ALAF> be useful from the command line :)
ALAF> My bet is that noone will ever use this method to select the interface
ALAF> and purposely also include a path name.
Example.
I have alsaplayer debian package which I use to usual play music.
I have alsaplayer in /usr/local/bin/alsaplayer which I use to develop.
When I want to listen music I type smth like 'alsaplayer-interface'.
BUT. When I wnat to try to run 'unstable' version
I type '/usr/local/bin/alsaplayer-interface'. Last way is not working for
me at first. And at second I can't run script with
'#!/usr/local/bin/alsaplayer-interface' as header coz kernel need full path
to of cmd after '#!'. You can say that I can use
'/usr/bin/env alsaplayer-interface'... 

Becouse:

--- /var/tmp/scrtest/scrtest.c:
#include <stdio.h>

int main (int argc, char *argv[])
{
    printf ("Arguments count provided: %u.\n", argc);
    printf ("Arguments: ");

    while (*argv)
	printf ("%s, ", *argv++);

    printf ("\n");

    return 0;
}
--- enf of /var/tmp/scrtest/scrtest.c

/var/tmp/scrtest% ./scrtest
Arguments count provided: 1.
Arguments: ./scrtest, 
/var/tmp/scrtest% cd /
/% /var/tmp/scrtest
Arguments count provided: 1.
Arguments: /var/tmp/scrtest/scrtest,
/% scrtest
zsh: command not found: scrtest

-- 
... Evgeny ... [Nightwish - Passion And The Opera ("Oceanborn" - 1998)]