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

Re: windows, shortcuts, and 'use lib'

Thread Next
Edward Peschko
May 14, 2003 17:39
Re: windows, shortcuts, and 'use lib'
Message ID:
I apologize if this is a dup, it looks like my email from my other account is getting
lost in a spam filter somewhere.

> On Sun, 11 May 2003 20:47:31 -0700, Edward Peschko <>
> wrote:
>>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.

I am using NTFS. It doesn't work. (see below )

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

Believe me, the first thing that I tried to do was use the 'link' interface in perl. You
say that it works, my windows XP and windows 2000 box says that it doesn't. Or it 'works'
in a weird, microsoftish way that only microsoft folks find in any way useful. Try:


where 'file' is 5000 bytes long. Edit 'file2' - add a byte. Do 'dir file*' and you will 

05/14/2003   11:05             5000 file
05/14/2003   11:05             5001 file2

I was wrong - it doesn't make a copy. It makes a fragile link, one which is broken any
time you edit the file. Doing a directory link simply doesn't work.

Anyways, I'm getting sick of trying to make hard links work, and even if did get them
to work, they aren't going to be a full solution - as someone said, anything with FAT32 
is excluded. I'm going to write a module for shortcuts. However, I'd like to make it 
*truly* integrated into perl, and to do that, I'd hope that:

	1) `` could be overloaded
	2) perl <shortcut> would follow the shortcut and run the file behind the shortcut.

#1 I think would be a given nice to have, I'd hope that #2 would be accepted.


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