Re: win32 inode fix

Lists: pgsql-patches
From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Neil Conway" <neilc(at)samurai(dot)com>, "Claudio Natoli" <claudio(dot)natoli(at)memetrics(dot)com>
Cc: <pgsql-patches(at)postgresql(dot)org>
Subject: Re: win32 inode fix
Date: 2004-02-09 12:21:18
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCE1715D6@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

> Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com> writes:
> > Under Win32, stat() returns an st_ino field, but it has no
> meaning (on
> > Win2K, and possibly all Win32 variants, it is always 0).
>
> MSDN says:
>
> Number of the information node (the inode) for the file
> (UNIX-specific). On UNIX file systems, the inode describes the
> file date and time stamps, permissions, and content. When files
> are hard-linked to one another, they share the same inode. The
> inode, and therefore st_ino, has no meaning in the FAT, HPFS, or
> NTFS file systems.
>
> I wonder if this might return non-zero for some relatively
> rare Win32 filesystems (say, an NFS share mounted via MS
> Services For Unix). Perhaps it might be cleaner to consider a
> zero inode "unknown", and therefore not equal to anything else?

It still returns 0 on a NFS share mounted with SFU (just tested). My bet
is that it will always return 0.

Might still be cleaner to change the code to make "zero equals unknown".
Is there a risk of another filesystem om some platform that won't return
inode?

//mha


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Magnus Hagander <mha(at)sollentuna(dot)net>
Cc: Neil Conway <neilc(at)samurai(dot)com>, Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: win32 inode fix
Date: 2004-02-09 16:35:44
Message-ID: 200402091635.i19GZi606373@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg토토 캔SQL :

Magnus Hagander wrote:
> > Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com> writes:
> > > Under Win32, stat() returns an st_ino field, but it has no
> > meaning (on
> > > Win2K, and possibly all Win32 variants, it is always 0).
> >
> > MSDN says:
> >
> > Number of the information node (the inode) for the file
> > (UNIX-specific). On UNIX file systems, the inode describes the
> > file date and time stamps, permissions, and content. When files
> > are hard-linked to one another, they share the same inode. The
> > inode, and therefore st_ino, has no meaning in the FAT, HPFS, or
> > NTFS file systems.
> >
> > I wonder if this might return non-zero for some relatively
> > rare Win32 filesystems (say, an NFS share mounted via MS
> > Services For Unix). Perhaps it might be cleaner to consider a
> > zero inode "unknown", and therefore not equal to anything else?
>
> It still returns 0 on a NFS share mounted with SFU (just tested). My bet
> is that it will always return 0.
>
> Might still be cleaner to change the code to make "zero equals unknown".
> Is there a risk of another filesystem om some platform that won't return
> inode?

In reading the patch, it seems he is only doing "zero equals unknown" on
Win32, so I think we are fine. We should continue using the inode on
Unix platforms.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Neil Conway <neilc(at)samurai(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: win32 inode fix
Date: 2004-02-09 17:44:26
Message-ID: 87fzdk4079.fsf@mailbox.samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> In reading the patch, it seems he is only doing "zero equals
> unknown" on Win32, so I think we are fine.

That's what I was trying to avoid: where possible, we shouldn't
introduce platform-dependent #ifdefs IMHO.

-Neil


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>, pgsql-patches(at)postgresql(dot)org
Subject: Re: win32 inode fix
Date: 2004-02-09 20:45:54
Message-ID: 200402092045.i19Kjsb22903@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Neil Conway wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > In reading the patch, it seems he is only doing "zero equals
> > unknown" on Win32, so I think we are fine.
>
> That's what I was trying to avoid: where possible, we shouldn't
> introduce platform-dependent #ifdefs IMHO.

But the platform doesn't give us what we want so I don't see why we
should weaken other platforms just for consistency.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: win32 inode fix
Date: 2004-02-09 21:15:04
Message-ID: 4027F858.8060704@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Bruce Momjian wrote:

>Neil Conway wrote:
>
>
>>Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>>
>>
>>>In reading the patch, it seems he is only doing "zero equals
>>>unknown" on Win32, so I think we are fine.
>>>
>>>
>>That's what I was trying to avoid: where possible, we shouldn't
>>introduce platform-dependent #ifdefs IMHO.
>>
>>
>
>But the platform doesn't give us what we want so I don't see why we
>should weaken other platforms just for consistency.
>
>

Surely the operative words are "where possible". Looks like this is one
case where it is not reasonably possible. I don't think we will ever be
totally rid of them. I tried quite hard to keep them to a minimum in
initdb, but eliminating them was not really an option.

cheers

andrew