Re: fsutil ideas

From: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers(at)postgresql(dot)org, Peter Brant <Peter(dot)Brant(at)wicourts(dot)gov>
Subject: Re: fsutil ideas
Date: 2006-02-24 00:16:37
Message-ID: 43FE5065.6040802@paradise.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kevin Grittner wrote:

> So, my questions:
>
> (1) Did I miss something regarding mingw support for statvfs?
>
> (2) If not, is it acceptable for a source file to contain that much
> #if code for Windows?
>
> I should probably also ask a tertiary question. His implementation
> reports space in 1K increments though int values. This effectively
> limits the maximum space which will be handled to 2 TB, which I'm told
> would be enough to cover our organization for the next ten years, but I
> suspect that the PostgreSQL community would prefer to see this handled a
> different way.
>
> (3) What data type should be used to report total space and free space
> for each volume?
>
> Thanks in advance for your responses.
>

No really answering your questions, but (if you haven't already) you
might want to consider creating a view that extracts all the interesting
stuff from the file_system() function - so that potential users can just
'\d' it to determine what it provides.

Also, not sure if its really important, but the man entry from statvfs
on FreeBSD is a little disconcerting:

<quote>
SYNOPSIS
#include <sys/statvfs.h>

int
statvfs(const char * restrict path, struct statvfs * restrict buf);

int
fstatvfs(int fd, struct statvfs *buf);

DESCRIPTION
The statvfs() and fstatvfs() functions fill the structure pointed
to by
buf with garbage. This garbage will occasionally bear resemblance to
file system statistics, but portable applications must not depend on
this. Applications must pass a pathname or file descriptor which
refers
to a file on the file system in which they are interested.

The statvfs structure contains the following members:

</quote>

I haven't tried out any code that uses it, so not sure if the 'garbage'
comment is valid.

regards

Mark

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-02-24 01:44:57 Re: suggestion
Previous Message Andrew Dunstan 2006-02-24 00:14:20 Re: fsutil ideas