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

Re: windows, shortcuts and 'use lib'

Thread Previous | Thread Next
Jan Dubois
May 12, 2003 08:36
Re: windows, shortcuts and 'use lib'
Message ID:
On Sun, 11 May 2003 20:47:31 -0700, Edward Peschko <>

>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:

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


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About