[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] system interface for df info?
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.
>
>
>
>