Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I was just wondering how a Windows system handles symbolic links. My best guess is that it will not recognize them, but I'm not entirely sure.

Also, what do Macs do when confronted by one?

share|improve this question
    
How do you plan to expose Windows to a symbolic link? It doesn't understand filesystems that support them (except NTFS, which has something not entirely unlike symbolic links that is mostly hidden from the UI). –  Gilles Jan 31 '13 at 0:57
    
Oh.. so what happens if you've mounted your Windows partition, and you try to put a symbolic link in it? Does it just work as if it were a folder? (If so, I wonder what happens with RECURSION...) –  JamesTheAwesomeDude Jan 31 '13 at 0:58
    
can you please help me on this : stackoverflow.com/questions/21403772/… –  Goofy Feb 1 at 14:04
add comment

1 Answer

up vote 4 down vote accepted

Depends on the Windows version and the configuration of the server-side when we talk about non-local disks.

Since Windows Vista, Windows does have an idea of symbolic links, but the semantics differ. But the more important problem here should be the path names, which follow a different syntax. For starters: single-rooted directory tree on the unixoid side and several drive letters as roots on the Windows side.

On the unixoid side symlinks are merely text files with a special flag. On the Windows side the underlying mechanism is called a reparse point. This tells the object manager to to pass it to particular registered filters (the meta-date for this is stored in the reparse points). Windows 2000 already introduced one type of reparse points known as junction points (roughly, but not quite, directory symlinks). With Vista they introduced symlinks to both files and directories, also on remote drives. And symlinks on remote drives are also supported to some extent.

The main point is whether the file system driver - when run locally - would do any adjustments to the paths Windows gets to see. In such a case it would work for certain local/relative symlinks. For absolute paths as targets things will get difficult and impossible to deduce what's meant. Same for remote symlinks links (to "network shares").

As for the Mac side I have no idea and it might make sense as a separate question. But as long as the server side conveys the information that this is a symlink, I see no problems, since they both follow the SUS semantics (unlike Windows).


Consider the Linux side mount points:

/dev/sda1 /
/dev/sda2 /home
/dev/sda3 /var

And now consider a symlink /home/paul/fstab pointing to /etc/fstab. They are located on two different volumes which Windows - if able to see them through a file system driver (which does work!) - can't tell belong together the way /etc/fstab describes it. So the link, which Windows would see under a folder \paul\fstab, even if translated, would point to \etc\fstab, which doesn't exist on /dev/sda2. And if that symlink would point to the relative path ../../etc/fstab things wouldn't change at all.


The gist: So while this is conceivable that you can get this to work for some corner cases, the fact that semantics and syntax differ on both sides of the fence makes it unlikely that you will find a practical and generic method that works.

share|improve this answer
    
Wow, this was a very detailed, thorough answer! Thank you for providing all this information! I actually had no idea that Linux's symlinks were text-based. Thank you again for all the useful information here. –  JamesTheAwesomeDude Jan 31 '13 at 1:01
    
can you please help me on this : stackoverflow.com/questions/21403772/… –  Goofy Feb 1 at 14:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.