Skip to content

Commit 0e484f1

Browse files
committed
Add link() info to TODO.detail.
1 parent 53e95ee commit 0e484f1

File tree

1 file changed

+185
-1
lines changed

1 file changed

+185
-1
lines changed

doc/TODO.detail/win32

Lines changed: 185 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6475,7 +6475,7 @@ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
64756475
X-Spam-Status: Yes, hits=5.0 required=5.0 tests=RCVD_IN_OSIRUSOFT_COM,X_OSIRU_SPAM_SRC version=2.20
64766476
X-Spam-Flag: YES
64776477
X-Spam-Level: *****
6478-
X-Spam-Checker-Version: SpamAssassin 2.20 (devel $Id: win32,v 1.1 2002/06/13 18:00:47 momjian Exp $)
6478+
X-Spam-Checker-Version: SpamAssassin 2.20 (devel $Id: win32,v 1.2 2002/09/16 02:47:05 momjian Exp $)
64796479
X-Spam-Report: Detailed Report
64806480
SPAM: -------------------- Start SpamAssassin results ----------------------
64816481
SPAM: This mail is probably spam. The original message has been altered
@@ -7319,3 +7319,187 @@ http://www.postgresql.org/users-lounge/docs/faq.html
73197319
---------------------------(end of broadcast)---------------------------
73207320
TIP 4: Don't 'kill -9' the postmaster
73217321

7322+
From pgsql-hackers-owner+M28769@postgresql.org Thu Sep 12 13:30:45 2002
7323+
Return-path: <pgsql-hackers-owner+M28769@postgresql.org>
7324+
Received: from postgresql.org (postgresql.org [64.49.215.8])
7325+
by candle.pha.pa.us (8.11.6/8.10.1) with ESMTP id g8CHUhE10966
7326+
for <pgman@candle.pha.pa.us>; Thu, 12 Sep 2002 13:30:44 -0400 (EDT)
7327+
Received: from localhost (postgresql.org [64.49.215.8])
7328+
by postgresql.org (Postfix) with ESMTP
7329+
id 40E144762BC; Thu, 12 Sep 2002 13:29:53 -0400 (EDT)
7330+
Received: from postgresql.org (postgresql.org [64.49.215.8])
7331+
by postgresql.org (Postfix) with SMTP
7332+
id 74F634761BD; Thu, 12 Sep 2002 13:29:51 -0400 (EDT)
7333+
Received: from localhost (postgresql.org [64.49.215.8])
7334+
by postgresql.org (Postfix) with ESMTP
7335+
id B0228475BEC; Thu, 12 Sep 2002 13:29:47 -0400 (EDT)
7336+
Received: from corvette.mascari.com (dhcp065-024-158-068.columbus.rr.com [65.24.158.68])
7337+
by postgresql.org (Postfix) with ESMTP
7338+
id 54553475AE5; Thu, 12 Sep 2002 13:29:46 -0400 (EDT)
7339+
Received: from mascari.com (ferrari.mascari.com [192.168.2.1])
7340+
by corvette.mascari.com (8.9.3/8.9.3) with ESMTP id NAA10985;
7341+
Thu, 12 Sep 2002 13:30:07 -0400
7342+
Message-ID: <3D80CEF0.1010900@mascari.com>
7343+
Date: Thu, 12 Sep 2002 13:29:20 -0400
7344+
From: Mike Mascari <mascarm@mascari.com>
7345+
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
7346+
X-Accept-Language: en-us, en
7347+
MIME-Version: 1.0
7348+
To: Mike Mascari <mascarm@mascari.com>
7349+
cc: "scott.marlowe" <scott.marlowe@ihs.com>,
7350+
Justin Clift <justin@postgresql.org>, Dave Page <dpage@vale-housing.co.uk>,
7351+
Bruce Momjian <pgman@candle.pha.pa.us>,
7352+
PostgreSQL Hackers Mailing List <pgsql-hackers@postgresql.org>
7353+
Subject: Re: [HACKERS] PGXLOG variable worthwhile?
7354+
References: <Pine.LNX.4.33.0209120945260.10924-100000@css120.ihs.com> <3D80C847.1070000@mascari.com>
7355+
Content-Type: text/plain; charset=us-ascii; format=flowed
7356+
Content-Transfer-Encoding: 7bit
7357+
X-MailScanner: Found to be clean
7358+
X-Virus-Scanned: by AMaViS new-20020517
7359+
Precedence: bulk
7360+
Sender: pgsql-hackers-owner@postgresql.org
7361+
X-Virus-Scanned: by AMaViS new-20020517
7362+
Status: OR
7363+
7364+
I wrote:
7365+
> scott.marlowe wrote:
7366+
>>
7367+
>> I wouldn't assume that. It's been years since I tested it, but back
7368+
>> then, the command line and all program I used could see the link
7369+
>> created by ln that came with the resource kit. They were distinctly
7370+
>> different from the shortcut type of links, in that they seems
7371+
>> transparent like short cuts in unix generally are.
7372+
>>
7373+
>> Do you have the resource kit or the gnu utils from it?
7374+
>
7375+
>
7376+
> The situation appears to be this:
7377+
>
7378+
> 1. Soft links are available on NTFS 5 (2K/XP) as Reparse Points via the
7379+
> DeviceIoControl() function for any application using the standard C
7380+
> library routines.
7381+
>
7382+
> 2. Soft links are available on any filesystem under 95/98/ME/NT4/2K/XP
7383+
> as OLE streams (.lnk files) for Shell-aware applications.
7384+
>
7385+
> 3. Hard links are available on NTFS 5 (2K/XP) via the CreateHardLink() API.
7386+
7387+
<snip>
7388+
7389+
> 4. Hard links are available on NTFS (NT3.1/NT4) via the BackupWrite()
7390+
> API by writing a special stream to the NTFS.
7391+
7392+
I also believe (I could be wrong) that for directories, the only
7393+
two methods of links are the Soft link methods above. So PGXLOG
7394+
cannot use soft links on a non-XP/2K machine unless it is
7395+
"Shell-Aware". For example, in a cygwin bash command window:
7396+
7397+
mkdir dir1
7398+
ln dir1 dir2 <- Error using Cygwin implementation
7399+
ln -s dir1 dir2 <- Creates a Shell short-cut (NT4)
7400+
echo "Hello" > dir1/test.txt
7401+
cat dir2/test.txt
7402+
"Hello" <- Cygwin's cat(bash?) is shell short-cut aware
7403+
7404+
Now, in a Windows NT command prompt:
7405+
7406+
notepad dir2\test.txt <- Notepad can't find file
7407+
notepad dir2.lnk <- Displays link contents
7408+
7409+
That means for a native port with a different PGXLOG directory
7410+
running on NT4, the only choice *using links* is to make the
7411+
native port shell short-cut aware.
7412+
7413+
I could be wrong but I don't think so.
7414+
7415+
Mike Mascari
7416+
mascarm@mascari.com
7417+
7418+
7419+
---------------------------(end of broadcast)---------------------------
7420+
TIP 5: Have you checked our extensive FAQ?
7421+
7422+
http://www.postgresql.org/users-lounge/docs/faq.html
7423+
7424+
From mascarm@mascari.com Thu Sep 12 13:01:55 2002
7425+
Return-path: <mascarm@mascari.com>
7426+
Received: from corvette.mascari.com (dhcp065-024-158-068.columbus.rr.com [65.24.158.68])
7427+
by candle.pha.pa.us (8.11.6/8.10.1) with ESMTP id g8CH1oE07922
7428+
for <pgman@candle.pha.pa.us>; Thu, 12 Sep 2002 13:01:53 -0400 (EDT)
7429+
Received: from mascari.com (ferrari.mascari.com [192.168.2.1])
7430+
by corvette.mascari.com (8.9.3/8.9.3) with ESMTP id NAA10893;
7431+
Thu, 12 Sep 2002 13:01:42 -0400
7432+
Message-ID: <3D80C847.1070000@mascari.com>
7433+
Date: Thu, 12 Sep 2002 13:00:55 -0400
7434+
From: Mike Mascari <mascarm@mascari.com>
7435+
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
7436+
X-Accept-Language: en-us, en
7437+
MIME-Version: 1.0
7438+
To: "scott.marlowe" <scott.marlowe@ihs.com>
7439+
cc: Justin Clift <justin@postgresql.org>,
7440+
Dave Page
7441+
<dpage@vale-housing.co.uk>,
7442+
Bruce Momjian <pgman@candle.pha.pa.us>,
7443+
PostgreSQL
7444+
Hackers Mailing List <pgsql-hackers@postgresql.org>
7445+
Subject: Re: [HACKERS] PGXLOG variable worthwhile?
7446+
References: <Pine.LNX.4.33.0209120945260.10924-100000@css120.ihs.com>
7447+
Content-Type: text/plain; charset=us-ascii; format=flowed
7448+
Content-Transfer-Encoding: 7bit
7449+
X-MailScanner: Found to be clean
7450+
Status: OR
7451+
7452+
scott.marlowe wrote:
7453+
> On Fri, 13 Sep 2002, Justin Clift wrote:
7454+
>
7455+
>>Would it be correct to say that the 'ln' command in the MS Resource Kit
7456+
>>creates this kind of shortcut too, as the Reparse Points feature doesn't
7457+
>>seem to be possible under NT4?
7458+
>
7459+
>
7460+
> I wouldn't assume that. It's been years since I tested it, but back then,
7461+
> the command line and all program I used could see the link created by ln
7462+
> that came with the resource kit. They were distinctly different from the
7463+
> shortcut type of links, in that they seems transparent like short cuts in
7464+
> unix generally are.
7465+
>
7466+
> Do you have the resource kit or the gnu utils from it?
7467+
7468+
The situation appears to be this:
7469+
7470+
1. Soft links are available on NTFS 5 (2K/XP) as Reparse Points
7471+
via the DeviceIoControl() function for any application using the
7472+
standard C library routines.
7473+
7474+
2. Soft links are available on any filesystem under
7475+
95/98/ME/NT4/2K/XP as OLE streams (.lnk files) for Shell-aware
7476+
applications.
7477+
7478+
3. Hard links are available on NTFS 5 (2K/XP) via the
7479+
CreateHardLink() API.
7480+
7481+
See:
7482+
7483+
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createhardlink.asp
7484+
7485+
4. Hard links are available on NTFS (NT3.1/NT4) via the
7486+
BackupWrite() API by writing a special stream to the NTFS.
7487+
7488+
Example:
7489+
7490+
http://www.mvps.org/win32/ntfs/lnw.cpp
7491+
7492+
The cygwin implementation of link():
7493+
7494+
http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/winsup/cygwin/syscalls.cc?rev=1.149.2.23&content-type=text/x-cvsweb-markup&cvsroot=src
7495+
7496+
1. Will use CreateHardLink() if on 2K/XP
7497+
2. Will try to use the BackupWrite() method
7498+
3. Failing #2 will just copy the file
7499+
7500+
See how fun Microsoft makes things?
7501+
7502+
Mike Mascari
7503+
mascarm@mascari.com
7504+
7505+

0 commit comments

Comments
 (0)