How interesting is the function popen, I think I'll do :D
#include <stdio.h>
main()
{
/* Fichero con el que abriremos date */
FILE *fichero=NULL;
/* Variable auxiliar para leer el fichero */
char aux[1000];
/* Se abre el fichero datey se comprueba
* que se ha podido abrir correctamente */
fichero = popen ("date", "r");
if (fichero == NULL)
{
perror ("No se puede abrir date");
exit (-1);
}
/* Se lee la primera linea y se hace un bucle, hasta fin de fichero,
* para ir sacando por pantalla los resultados.
*/
fgets (aux, 1000, fichero);
while (!feof (fichero))
{
printf ("%s", aux);
fgets (aux, 1000, fichero);
}
/* Se cierra el fichero */
pclose (fichero);
}
I get a file system information, nothing else I have to save the data that
returns me a file and read what I need, thanks
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|