Discussione: [C] Linux pipe
View Single Post
Old 03-04-2010, 16:02   #6
marco.r
Senior Member
 
Iscritto dal: Dec 2005
Città: Istanbul
Messaggi: 1817
Quote:
Originariamente inviato da Teo@Unix Guarda i messaggi
Ciao, c'è un metodo per mettere in pausa il processo principale in attesa che il processo filgio avviato con la funzione popen() ha terminato?

Oppure occorre fare manualmente con fork() ecc..? Nel mio caso si tratta di meno di mezzo secondo però mi scoccia mettere usleep(500000) dopo popen() per evitare errori di visualizzazione sul terminale.
Inolter il valore di usleep() potrebbe non andate bene su altri sistemi magari più lenti.

Non ho cercato molto a dire il vero, sapete consigliarimi? Grazie.
Da http://linux.die.net/man/3/pclose

Quote:
The pclose() function waits for the associated process to terminate and returns the exit status of the command as returned by wait4().
__________________
One of the conclusions that we reached was that the "object" need not be a primitive notion in a programming language; one can build objects and their behaviour from little more than assignable value cells and good old lambda expressions. —Guy Steele
marco.r è offline   Rispondi citando il messaggio o parte di esso