# FileUtils.ln\_s in Vista

**URL:** <https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848>\
**Category:** Ruby\
**Created:** [October 31, 2007, 4:48pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848 "2007-10-31T16:48:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [October 31, 2007, 4:48pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/1 "2007-10-31T16:48:21Z")

</div>

I just found out that Windows Vista supports symbolic links. In fact, it  
has  
a new command line tool “mklink” for that.  
However, 1.8.6 says that the functionality is not supported.

So,

1.Is there a more recent version that support true symlinks in Vista?

2.If not, how do I detect the host platform so I can call Vista’s own  
mklink instead?

TIA

Fernando C.

---

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [October 31, 2007, 9:59pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/2 "2007-10-31T21:59:47Z")

</div>

Fernando C. wrote:

> I just found out that Windows Vista supports symbolic links.

Contrary to Microsoft propaganda that says this feature was modeled  
identical to Unix, Vista still does not support true symlinks. Their  
current implementation suffers from:

- being limited to a max of 31 symlinks per directory.
- relative symlinks cannot cross volumes.
- mklink forces you to distinguish between a file or directory.
- other pre-vista windows versions on a network cannot see the  
symlinks (unlike Samba).
- NTFS only, not available on FAT.

> 2.If not, how do I detect the host platform so I can call Vista’s own  
> mklink instead?

RUBY\_PLATFORM =~ /win/

further check on OS version requires platform specific code or  
checking the version of cmd.exe or similar. Sys::Admin may give you a  
more friendly way to do this.

---

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [November 1, 2007, 12:06am UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/3 "2007-11-01T00:06:03Z")

</div>

On Oct 31, 2007 9:58 PM, gga [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Fernando C. wrote:
> 
> > 2.If not, how do I detect the host platform so I can call Vista’s own  
> > mklink instead?
> 
> RUBY\_PLATFORM =~ /win/

This is not going to work as expected on Mac OS X environments (which  
have a RUBY\_PLATFORM that contains “darwin”).

The following would perhaps be better: RUBY\_PLATFORM =~  
/mswin32|cygwin|mingw|bccwin/

Laurent

---

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [November 5, 2007, 6:19pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/4 "2007-11-05T18:19:51Z")

</div>

Laurent S. wrote:

> The following would perhaps be better: RUBY\_PLATFORM =~  
> /mswin32|cygwin|mingw|bccwin/

OK

Thanks

---

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [November 3, 2007, 4:20pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/5 "2007-11-03T16:20:56Z")

</div>

Hi!

> I just found out that Windows Vista supports symbolic links.

Junction points (for files) & hardlinks (for dir) exists on Vista, on  
XP, on Win-2000…

–  
@-salutations

Michel Claveau

---

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [November 5, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/6 "2007-11-05T18:22:12Z")

</div>

gga wrote:

> Fernando C. wrote:
> 
> > I just found out that Windows Vista supports symbolic links.
> 
> Contrary to Microsoft propaganda that says this feature was modeled  
> identical to Unix, Vista still does not support true symlinks. Their  
> current implementation suffers from:

> - being limited to a max of 31 symlinks per directory.

Grrrrr, how useless.

> - relative symlinks cannot cross volumes.
> - mklink forces you to distinguish between a file or directory.
> - other pre-vista windows versions on a network cannot see the  
> symlinks (unlike Samba).
> - NTFS only, not available on FAT.

The above are not a problem in my specific case… but the 31 cap is a  
showstopper.

> > 2.If not, how do I detect the host platform so I can call Vista’s  
> > own mklink instead?
> 
> RUBY\_PLATFORM =~ /win/

OK

> further check on OS version requires platform specific code or  
> checking the version of cmd.exe or similar. Sys::Admin may give you a  
> more friendly way to do this.

I will have to resort to hardinks for Windoze so I won’t have to  
distinguish  
them.  
Thans for the tip though.

Thanks

---

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [November 5, 2007, 8:05pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/7 "2007-11-05T20:05:18Z")

</div>

Fernando C. wrote:

> gga wrote:
> 
> > Fernando C. wrote:
> > 
> > > 2.If not, how do I detect the host platform so I can call Vista’s  
> > > own mklink instead?
> > 
> > RUBY\_PLATFORM =~ /win/
> 
> OK

It was just pointed out that

“darwin” =~ /win/

mortee

---

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [November 5, 2007, 6:23pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/8 "2007-11-05T18:23:22Z")

</div>

MC wrote:

> Hi!
> 
> > I just found out that Windows Vista supports symbolic links.
> 
> Junction points (for files) & hardlinks (for dir)

It’s Junction for directories and hardlinks for files (the opposite).

> exists on Vista, on  
> XP, on Win-2000…

Ya, but I was referring to symlinks, not hardlinks.

---

<div class="post-metadata">

**Author:** ![fernan2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/c5a1d2/32.png) [@fernan2](https://www.ruby-forum.com/u/fernan2)\
**Post date:** [November 6, 2007, 2:12pm UTC](https://www.ruby-forum.com/t/fileutils-ln-s-in-vista/118848/9 "2007-11-06T14:12:51Z")

</div>

Hi,

At Thu, 1 Nov 2007 05:58:24 +0900,  
gga wrote in [ruby-talk:276964]:

> Fernando C. wrote:
> 
> > I just found out that Windows Vista supports symbolic links.
> 
> Contrary to Microsoft propaganda that says this feature was modeled  
> identical to Unix, Vista still does not support true symlinks. Their  
> current implementation suffers from:
> 
> - being limited to a max of 31 symlinks per directory.

Is this true? I tried it and successed creating 70 symlinks  
(just interrupted then).
