I\'m using the following code to try to read the results of a df command in Linux using popen.
df
popen
#include // file an
check your bufSize. ftell can return -1 on error, and this can lead to nonallocation by malloc with buffer having a NULL value.
ftell
The reason for the ftell to fail is, because of the popen. You cant search pipes.