[ale] system interface for df info?

Jim ale_nospam at fayettedigital.com
Sun Jan 22 05:42:50 EST 2006


Very helpful, thank you.

Jim.
Christopher Fowler wrote:

>df gets its information using statfs()
>
>        statfs("/", &buf);
>
>        bsize = buf.f_bsize;
>        printf("\tTotal Bytes:   %10lu Kb\n", (buf.f_blocks * bsize) /
>1024);
>        printf("\tUsed Bytes:    %10lu Kb\n", ((buf.f_blocks -
>buf.f_bfree) * bsize) / 1024);
>        printf("\tFree Bytes:    %10lu Kb\n", (buf.f_bfree * bsize) /
>1024);
>
>
>Thats how I do it on our embedded device.
>
>
>  
>




More information about the Ale mailing list