I would like to ask if anyone know why when i put the code like this:
char buff[100];
FILE *pf = popen("/bin/file ola.png", "w");
fscanf(pf, "%s", buff);
pclose(pf);
It prints: ola.png: Zip archive data, at least v1.0 to extract
And if i put:
char buff[100];
FILE *pf = popen("/bin/file ola.png", "r");
fscanf(pf, "%s", buff);
pclose(pf);
printf("%s", buff);
it prints just: ola.png:
I would like it to save the entire phrase on the buffer, not just ola.png:
Thank you!