develooper Front page | perl.perl5.porters | Postings from May 2003

Re: windows, shortcuts and 'use lib'

Thread Previous | Thread Next
From:
Jan Dubois
Date:
May 12, 2003 08:36
Subject:
Re: windows, shortcuts and 'use lib'
Message ID:
93fvbv0n27ibapa7e26h6oc9leng6ism1n@4ax.com
On Sun, 11 May 2003 20:47:31 -0700, Edward Peschko <esp@pyroshells.com>
wrote:

>On Mon, Apr 28, 2003 at 05:06:54PM -0400, Tim Fries wrote:
>> With NT/2K/XP, you can use the function CreateHardLinkA or
>> CreateHardLinkW from kernel32.dll to create filesystem-level hard
>> links on NTFS volumes.

CreateHardLink() is only available in 2K and XP, not in NT.

>wow.. I almost missed this post... really helpful.. I have a couple of 
>questions though.
>
>    1) is there a CreateSoftLinkW and CreateSoftLinkA..

This thread is getting kind of boring: NTFS reparse points are the closest
you can get to soft links on Windows.  Please look at my previous post for
limitations on reparse points.

>    2) where can I find the documentation on the usage of these
>       commands? 
>    3) does this support file as well as directory links?
>
>Anyways, I downloaded hard link magic, and it looks like its only a gui
>wrapper. And is there a command line tool to do this?
>
>And finally, I noticed that - in win32 perl - link('file','file2'); is a file 
>only does a copy, and that link('directory', 'directory2') doesn't do
>anything at all.

This is not true if you are using NTFS.

>If you *can* do this at the OS level, would a patch to make link work by 
>creating hard links using these calls be accepted?

If you were researching this a bit better before posting, then you would
have noticed that Perl already supports hardlinks on NTFS.  I added a
patch for this in November 1999:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-11/msg00301.html

It even emulates CreateHardLink() on Windows NT. :)

Cheers,
-Jan


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About