On Sat, Nov 13, 2004 at 02:08:04AM +0900, Berger, Daniel wrote:
> Hi all,
> 
> I noticed that win32.c in 1.8.2 p3 contained a link() function (or maybe
> it was always there and I never noticed).  Anyway, it doesn't seem to
> work properly.
> 
> File.link("C:\\temp.txt","C:\\temp.lnk")
> 
> It creates a shortcut, but it's busted.  Double clicking on the shortcut
> does nothing.  If I right click on the shortcut in Windows Explorer and
> select the "shortcut" tab it says, "This is not a valid shortcut".
> 
> Any ideas?

File.link uses CreateHardLinkA which creates a "hard link" (using
inodes) rather than a shortcut.

Try doing
 File.link("C:\\temp.txt","C:\\temp2.txt")
and then reading the "temp2.txt" file.

This will only work on NTFS I think.

It's like using the `ln' program on a unix system.