Vous n'êtes pas identifié.
Pages: 1
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 :!:
Hors ligne
verify que t'es bien en tiny mode et que tu transmet bien l'argument 0 au programme qui est son chemin complet.
Hors ligne
la fonction execv elle est dans casiob.h ou sinon ou je peux la trouveé ?? merci !
Hors ligne
A moi aussi ce serait utile parce que chez oim çà plante la caltos.
Et kan je la ralumme ,RESET mem Principal §
Hors ligne
execv est une fonction du langage C...
bon voilà le code de la fonction de T_EXPLORER:
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
Hors ligne
je crois que ca marche
merci beaucoup 2072.
merci a tous.
Hors ligne
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 ??
Hors ligne
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
++
Hors ligne
Pages: 1