FileUtils.ln_s in Vista

F

Fernando Cacciola

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 Cacciola
 
G

gga

Fernando said:
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.
 
L

Laurent Sansonetti

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
 
F

fernando.cacciola

Laurent said:
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/
OK

Thanks
 
F

fernando.cacciola

gga said:
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.
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
 
F

fernando.cacciola

MC said:
Hi!


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.
 
N

Nobuyoshi Nakada

Hi,

At Thu, 1 Nov 2007 05:58:24 +0900,
gga wrote in [ruby-talk:276964]:
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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,270
Messages
2,571,349
Members
48,035
Latest member
SamuelDieng

Latest Threads

Top