Unix Programming - Re: Retrieving block size of a filesystem

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2004 > Re: Retrieving block size of a filesystem





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: Retrieving block size of a filesystem
Barry Margolin

2004-05-25, 2:33 am

In article <HQUrc.218$Ux3.202@newsfe4-gui>,
"Kieran Simkin" <kieran@digital-crocus.com> wrote:

> I'm writing some code in C to check user's disk space usage. The quotactl()
> function I'm using gives me a block count for each user, but I need to
> transform this into a byte count, I know on my personal system that each
> block is 512 bytes big, but is there a better (read more portable) way find
> out how many blocks are used per byte on a specific filesystem?


fsstat()

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Barry Margolin

2004-05-25, 2:33 am

In article <HQUrc.218$Ux3.202@newsfe4-gui>,
"Kieran Simkin" <kieran@digital-crocus.com> wrote:

> I'm writing some code in C to check user's disk space usage. The quotactl()
> function I'm using gives me a block count for each user, but I need to
> transform this into a byte count, I know on my personal system that each
> block is 512 bytes big, but is there a better (read more portable) way find
> out how many blocks are used per byte on a specific filesystem?


Oops, ignore my last response. I meant statfs(), or statvfs().

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com