Forum Graph100

Forum Graph100

Vous n'êtes pas identifié.

Annonce

Bonjour et bienvenue sur le nouveau Forum Graph100 !
L'intégralité des données a été transférée sur un forum PunBB et tout les comptes sont fonctionnels avec le même nom d'utilisateur et mot de passe.
Un wiki est aussi disponible avec le même compte ! N'oubliez pas de remettre votre avatar, bon surf !
Pour plus d'informations, consultez ce post.

#1 17 Jun 2002 12:27:05

Wael Nasreddine
Membre
Date d'inscription: 28 May 2002
Messages: 37

aide sur l'exec d'un autre prog a partir du prog prinicpale

je veux executer un programme a partir du programme principale
j'ai essaye l'instruction execv(path,arguments) et j'ai eu un ROM-DOS fatal error.
j'ai essaye l'instruction spawnl(P_WAIT,path,arguments) et j'ai eu un Insuffisent Memory.
j'ai essaye l'instruction spawnl(P_NOWAIT,path,arguments) et j'ai eu un Invailed argument.
j'ai essaye l'instruction spawnl(P_OVERLAY,path,arguments) et j'ai eu un ROM-DOS Fatal Error.


qu'est-ce que je dois faire :?:  :?:  :?:  :?:  :?:  :?:  :?:  :?:
j'utilise le compilateur TC3.0 :!:  :!:  :!:  :!:  :!:  :!:
Merci :!:


Wael Nasreddine

Hors ligne

 

#2 17 Jun 2002 14:29:24

2072
Programmeur Graph100
Lieu: Somewherebourg
Date d'inscription: 29 Jan 2002
Messages: 2056
Site web

Re: aide sur l'exec d'un autre prog a partir du prog prinicpale

verify que t'es bien en tiny mode et que tu transmet bien l'argument 0 au programme qui est son chemin complet.


-~2072~-
Paid Emails
[URL=http://www.2072productions.com]2072productions.com[/URL]
[URL=http://www.casiocalc.org]casiocalc.org[/URL]

Hors ligne

 

#3 18 Jun 2002 01:49:39

deather
Membre Communauté Graph100
Lieu: Banlieue parisienne (Fresnes)
Date d'inscription: 05 May 2002
Messages: 909

Re: aide sur l'exec d'un autre prog a partir du prog prinicpale

la fonction execv elle est dans casiob.h ou sinon ou je peux la trouveé ?? merci !


..:: Deather ::..
deather.dede@gmail.com.NO.SPAM

Hors ligne

 

#4 18 Jun 2002 04:43:42

Azor
Le Coté Obscur De La G100
Lieu: glop glop!
Date d'inscription: 04 May 2002
Messages: 5479
Site web

Re: aide sur l'exec d'un autre prog a partir du prog prinicpale

A moi aussi ce serait utile parce que chez oim çà plante la caltos.

Et kan je la ralumme ,RESET mem Principal §


Anciennement X-thunder28
Cats shall rule teh world!

Hors ligne

 

#5 18 Jun 2002 14:36:23

2072
Programmeur Graph100
Lieu: Somewherebourg
Date d'inscription: 29 Jan 2002
Messages: 2056
Site web

Re: aide sur l'exec d'un autre prog a partir du prog prinicpale

execv est une fonction du langage C...

bon voilà le code de la fonction de T_EXPLORER:

Code:

void execute(char *pathp)
{
    char command[128];//buffer for the command line
    char *args[64];//table of arguments
    int i;
    int numberofargs    =0;//no comment
    int    execres;
    int a        =0;
    int cline_size;//size of the command line

    cline_size=strlen(pathp);//cline_size is set
    if (cline_size > 128)//Error if the command line size is more than 128
    return;

    printf("nExecuting :n%sn", pathp);

    //This, below, scan the command line to find space characters
    for (i=0; i <= cline_size; i++)
    {
    if (pathp[i]!=(char)32)//if there is no space
    {
        if (a==0)//if it is the first character of the arg
        args[numberofargs]=&command[i];//copy the address of the first arg
        command[i]=pathp[i];//copy the arg in command
        a++;//a is increased till a space is found
    }
    else if (a > 0 && args[numberofargs][a - 1]!=(char)32)//if a space is found after
        //an argument and if the
        //previous character wasn't a
        //space
    {
        command[i]='';//this end the argument
        numberofargs++;//a new argument has been found
        a=0;//reset the index of character of the argument
    }
    }
    args[numberofargs + 1]=NULL;//This is for the last argument

    execres=execv(args[0], args);//execute the progs with the argument list

    if (execres==-1)//if error
    {

    perror("ERROR while executing");
    }

    bioskey(0);
    return;

}

pathp doit contenir le chemin complet du programme suivi ou non de plusieurs argument séparé par un ou plusieurs espaces.

Faîtes en bonne usage  wink


-~2072~-
Paid Emails
[URL=http://www.2072productions.com]2072productions.com[/URL]
[URL=http://www.casiocalc.org]casiocalc.org[/URL]

Hors ligne

 

#6 19 Jun 2002 01:20:19

Wael Nasreddine
Membre
Date d'inscription: 28 May 2002
Messages: 37

Re: aide sur l'exec d'un autre prog a partir du prog prinicpale

je crois que ca marche
merci beaucoup 2072.
merci a tous. big_smile  big_smile  big_smile  big_smile  big_smile


Wael Nasreddine

Hors ligne

 

#7 19 Jun 2002 02:48:06

deather
Membre Communauté Graph100
Lieu: Banlieue parisienne (Fresnes)
Date d'inscription: 05 May 2002
Messages: 909

Re: aide sur l'exec d'un autre prog a partir du prog prinicpale

ouais x thunder a raison dé foa quand jalume ma caltos y reset les mem principal mem quand elle a pas planté et apres tu te tape tout les fichier basic a refaire  :cry:  :cry:  :cry:  vs savé pkoi ??


..:: Deather ::..
deather.dede@gmail.com.NO.SPAM

Hors ligne

 

#8 19 Jun 2002 13:48:55

Bebert
Testeur G100
Lieu: Le Havre
Date d'inscription: 29 Jan 2002
Messages: 1014

Re: aide sur l'exec d'un autre prog a partir du prog prinicpale

me vous ave le cable alor pk vs sover po les fichiers basic come ca hop z'ete pu emmerder si fo les refere juste un trans e c good
++


http://informatiquefrance.free.fr/sms/sms_03.jpg
:shock: YPST5Z-AV380-PSS110 / NGage-P910i / NeoGeo PC-DS-PSP / DC-PS2-GC / Nvidia-AMD64-3500+Force7900GTX XFX-1Go GEIL ONE TTC :shock:

Hors ligne

 

Pied de page des forums

Propulsé par PunBB
© Copyright 2002–2005 Rickard Andersson
Traduction par punbb.fr