21.Lucrul cu procese Unix-exec, system, popen.txt

Embed Size (px)

Citation preview

  • 21.Lucrul cu procese Unix: funciile exec, system, popen

    *system-creeaza un nou proces in care cheama shell, shell cheama comanda, executa si apoi sereintoarce controlul dupa system

    *popenFILE *popen(const char *comanda,const char *tip)//tip: "r","w"int pclose(FILE *f)-deschide un pipe, apoi executa un fork.Procesul fiu executa prin exec comanda-pclose -inchide pipe-ul si intoarce codul de retur al comanda sau -1 la esec