[so] Re: parametrii execv
Maria Nadejde
mnadejde at yahoo.com
Wed Oct 31 22:44:35 EET 2007
Evident ca dupa ce am trimis mailul mi-am dat seama ce
greseam:D...trebuia sa folosesc o alta variabila pt
primul parametru...nu mergea cu args[0]:D
--- Maria Nadejde <mnadejde at yahoo.com> wrote:
> Date: Wed, 31 Oct 2007 13:38:04 -0700 (PDT)
> From: Maria Nadejde <mnadejde at yahoo.com>
> Subject: parametrii execv
> To: so at cursuri.cs.pub.ro
>
> Am si eu o intrebare:
>
> de ce nu merge execv cand ii dau urmatorii
> parametrii:
>
> char *args[3];
> args[0]="mkdir";
> args[1]="hipo";
> args[2]=NULL;
> fork() case 0:
> execve_rv=execv(args[0],args);
>
> dar merge:
> execlp_rv=execlp(args[0],args[0],args[1],NULL);
>
> nu merge nici cu:
> char *argumente[100];
> argumente[nr_argumente]=(char*)word_crt->string;
> nr_argumente++;
> word_crt=word_crt->next_word;
> fork()
> case0:
> execve_rv=execv(argumente[0],argumente);
> nici cu:
> char **manevra;
> for(i=0;i<=r_argumente;i++)
> {
> manevra[i]=(char*)malloc(20);
> manevra[i]=argumente[i];
>
> }
> fork()
> case0:
> execve_rv=execvp(manevra[0],manevra);
>
> dar la toate merge cu execlp..deci nu citeste
> argumentele din args sau argumente sau manevra:(?
>
> What am i doing wrong:(((?
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the so
mailing list