Posted
by
Zonkon Monday October 31, 2005 @06:36AM
from the sounds-like-another-os-i-know dept.

TheRealSlimShady writes "According to a post by Ward Ralston on the Windows server team's weblog, Vista server is to get symlinks as part of the SMB2 protocol." From the post: "In Vista/Longhorn server, the file system (NTFS) will start supporting a new filesystem object (examples of existing filesystem objects are files, folders etc.). This new object is a symbolic link. Think of a symbolic link as a pointer to another file system object (it can be a file, folder, shortcut or another symbolic link)."

I recall this [slashdot.org] Slashdot story from several years ago (damn, I can't believe a Slashdot headline has stayed with me that long). Sadly, the links referenced in the article are broken, so I don't recall exactly what it was about.

No, in two years time everyone will be running around saying that MS copied it from Apple. Then someone else will jump in and say that Apple stole it from Unix. After that, someone else will claim that Apple stole it from Xerox. And I'm sure after further debate someone else will mention that it was originally an idea first postulated by the ancient greeks, before computers were even invented.

Why would Microsoft do that, when even many Linux supporters agree that Windows permissions are finer grained? But if the new Windows is BSD-based, Microsoft would be forced to do that, or face rewriting a lot of the underlying BSD code.

Second, there was Microsoft's announcement that Unix compatibility will be "built in" to Vista:

Does anyone really think that Microsoft could succeed in doing a major rearchitecturing of the Windows code now, in only 18 months, after they had tried and failed to do so many times over the last decade?

Besides, when has Microsoft ever shown the confidence or ability to succeed on their own? DOS, Windows NT, Internet Explorer, and.Net, were all based on other companies' products, or were developed by teams hired from outside.

And now we have this new report that another basic feature of Unix, symbolic links, will be part of Vista.

Given all this evidence, I am fairly convinced that Vista will be based on one of the Open Source BSD distributions. Unlike Apple, however, Microsoft will probably try to keep it a secret, and claim it as their own innovation.

What will be the result?

On one hand, a BSD-based Vista might be a good thing, since it will result in a more stable, and less virus-prone Windows.

On the other hand, if Microsoft remains true to their history, they'll just screw it up with all the lock-in features they'll add on top. Like the VMS-and-OS/2-based Windows NT, which started out strong (version 3.51) then gradually degraded, I expect the benefits of a BSD-based Vista to be temporary.

Then again, Microsoft is just playing for time, as they continue their strategy of locking in the Internet. Thus, they only need Windows to be better for long eneough to fool their customers, again, while they tie them up with a new set of decommoditized protocols (.Net, Palladium, DRM, Windows Media, Office 12, and so on).

Man, I LOVE/. posters.So you have three reports on/. One of them describes a feature that's been in Windows since NT 3.1 (and exposed as a public API since Windows 2000) (symlinks). The other describes an existing feature that's been available for Windows since NT 4 and is now apparently being included in the OS base (SFU). And the third that describes a feature that's been available for Windows since NT 3.1 (and made really usable in XP) (limited rights user accounts).

The whole point of symbolic links is that they're transparent. That way, an application doesn't have to parse a.lnk file. The OS handles reading/writing from the correct file. Real file symlinks have been missing from Windows for too long, I think it's about time they were added. (Whether or not anybody actually uses them instead of shortcuts is another story.)

Yes, you could essentially re-implement Explorer in every app written by having them handle the *.lnk files the way Explorer does. It sort of is counterproductive. It is much cleaner to have that in the filesystem (or at least the MS APIs to open files) so that it is transparent to apps. Frankly the way the shortcut thing was implemented is a ugly hack. I figured what happened is that they wanted the symlink concept, but didn't want to (or couldn't) change the filesystem. Looks like they're finally (10 years later) decided to do it right.

As far as users are concerned, I suspect they won't know/see the difference. Creating symlinks will just work like creating shortcuts.

I don't believe that the word innovate was used anywhere except here on slashdot. While it's been a long time coming, the blog entry that originally posted this admits that all these additions are addressing limitations in SMB.

It's not like Linux never copied an idea from another OS, yet it seems MS is not allowed to add a feature unless they thought of it themselves.

But then I guess everyone here gets a bit bitter when there is one less thing to complain about MS.

NTFS already had symlinks. Just that Explorer and cmd.exe didn't used the feature. But if created (with a third party tool) they are properly used.
Also, FAT had initially a flag indicating that an object is not a file, nor a folder, but a symlink. Unfortunately, the attribute got later used as a "Long Filename Part no. X" flag... talk about bad design..

There is a huge difference between the two: a hard link is filesystem-level (simply a second entry in a directory to a file); a symlink is OS-level. One cannot cross filesystem boundaries (being filesystem-level), the other can.

The one fact you forgot to add that makes MS's current implementation poor is that the link becomes a drive letter, and how many in total can you have with Windows?

That would be really funny if it was true.

It is, alas, false, and junctions do not become "a drive letter", they are virtual folders akin to Linux' directory symlinks (since junctions sadly don't handle the file level but only the directory one).

I don't know where you got your info from, but plugging in a hotswap disk does NOT require a reboot, and hasn't since at least Windows 2000, but probably even NT 4. Open computer management, go to disk configuration, and click "rescan disks". It'll detect the drive just fine.

95%++ of the world's computers running Windows NT-based Operating Systems by now

Actually, 95% of the world's computers are embedded microproccessors, most of which don't even run anything classified as an "operating system", let alone windows. I expect that what you meant was that 95% of PC's are running Windows NT based operating systems. I doubt that, there are still plenty of older, pre-XP home machines in use today, so probably as many as 15-20% of PC's are running Windows 9x-based operating systems. Yo

That after all those years Microsoft still has drive letters with a dirty hack (my desktop / my computer/whatever) to 'unify' them, has only broken symlink functionality (shortcuts), and only now mentiones symlinks is quite pathetic, if you ask me.

Backward compatibility is absolutely indispensable for Microsoft - the only reason it's still the market leader after all the lawsuits, bad publicity and downright talented competition of the last few years is because nobody wants to break compatibility with their existing software, documents, networks and hardware. Microsoft understands this, and while I'm sure it drives a lot of MS developers insane, backward compatibility is always given top priority, even if it makes the architecture horribly ugly and illogical.

(If you want to see the Unix equivalent, read the chapter on terminal I/O in Stevens' Advanced Programming for the UNIX Environment. There are backward compatibility hacks in there that are so ugly you'll wish you'd been born blind.)

Sorry, but that dog don't hunt this time. It's trivial to write a filesystem driver to create a virtual drive letter for legacy applications that would need such while at the same time making useful things available like true loing filenames, symbolic links, etc.That's the same excuse that they used for using FAT32 in Win9x, but OS/2 proved them wrong even before the first Win9x release when OS/2 2.0 allowed DOS and Windows programs to install and run on an HPFS partition. Even Windows 3.1 itself could be

Well, a shortcut will only work when used from within the Windows shell, it is a construct of the shell, and other apps don't understand short-cuts. To other apps, short-cuts look just like a file. With symbolic links, this concept is taken and is implemented within the file system. Apps when they open a symbolic link will now open the target by default (i.e. what the link points to), unless they explicitly ask for the symbolic link itself to be opened.

Say you have a 1000-byte file called MyDocument1.doc.vistalnk on your desktop. It points to the real MyDocument1.doc somewhere else on your system.

If you open the file up in XP, Word will be very confused, and if anything, display the 1000-byte gibberish. In Vista, Word (and Outlook, and everything else) will automatically do the right thing, and read the contents of MyDocument1.docwithout having to change any code in Word/Outlook/etc.

The readlink() function shall place the contents of the symbolic link referred to by path in the buffer buf
which has size bufsize. If the number of bytes in the symbolic link is less than bufsize, the contents of the
remainder of buf are unspecified. If the buf argument is not large enough to

Some of the Vista previews have shown off things dubbed "virtual folders" which work in a similar way to browsing by artist or album in the current version of Media Player. You can manipulate the files like it's a normal folder window, yet the actual files may be scattered over different folders and drives. Presumably it's an effort to make managing large amounts of music/video outside of Media Player easier. They almost certainly use these symbolic links. They're a bit different from shortcuts.

Nope, those virtual folders are actually search-parameters saved in a xml-format, which is known already [winsupersite.com]. Paul gets them wrong or at least gives a shitty explanation (he says these xml files store the results, but that wouldn't be dynamic as he claims as well), instead you click 'em and the search is fired up using the stored parameters, e.g. *.mp3

"Now why is this relevant to the SMB2 protocol? This is because, for symbolic links to behave correctly, they should be interpreted on the client side of a file sharing protocol (otherwise this can lead to security holes). "

Is it not rather:

"If the client does not interpret symbolic links then nothing will work?"

Presumably the security problem has something to do with symlinks that point to a file that the client does not have permission to read. If the server handles symlinks in a naive way, then on a request to open() a symlink it would open the target file (which is the usual behaviour of opening a symlink), but potentially with the wrong permissions.

If the server did no special behaviour for symlinks then they would appear to the client as a duplicate of the symlink target, an ordinary file.

Doesn't really matter if Win2K could do it if the feature was buried and the user had no way to use it. Also, Sys Internals seems to imply that only directories may be linked, not specific files. Not quite the same thing.I've been wishing Windows would support this elemental feature for a long time now. I would have used it to create a directory tree with the structure I wanted to burn on CD, without having to move all the actual files around. The CD burning software I've tried doesn't understand shortc

If junctions only work on directories then you'd want to look at the CreateHardLink API [microsoft.com] (available in Win2K/XP/2003) which works only on files. You can create up to 1023 links to a single file using this API.

Hard links are different to soft links (symlinks). Hard links are two (or more) files that refer to exactly the same physical storage; rather than one file being a link to the other file, both links are precisely equivalent. This is completely transparent - multiply-linked files are indistinguishable from singly-linked files.

Soft links are represented as a special text file that contains the name of the linked file. The default behavior on opening a soft link is to redirect and open the target file ins

Junction points on NTFS are neither symlinks nor hardlinks: they are mountpoints for system volumes (partitions). Basically, they are the way NT deals with the Unix way of doing things (instead of the DOS way of assigning letters to volumes).

NTFS does support hardlinks and, as the developers of the NTFS driver for Linux recently discovered (see details in this thread [theaimsgroup.com]), it also supports symlinks, provided Microsoft Services For Unix are installed.

The important part of all this, is, I think, that open source tools ranging from the linux fs drivers (ntfs and cifs/smb) to the cygwin stuff should get updated and start managing the thing the way MS does it (on MS filesystems, of course).

They aren't just mount points for volumes. You can mount a volume to multiple places with junctions. You can also use a junction to link C:\temp\directory to X:\anotherplace\asubdir\destination.The pain (or feature) with junctions is the source directory doesn't have to be empty. As a System Administrator in the Managed Storage group this can be an incredible pain. If the destination points to another drive you don't want to include it in the backups since things will get backed up twice (since the os w

Junction points, at least the ones created by the utility referred to, are in fact hard directory links. You can mount any directory from any NTFS volume as a directory at any point in any NTFS volume's tree, not just whole partitions.

I have used junction.exe many times to save a lot of reorganization by mounting a directory from one volume onto another when the other is full and there is no unallocated space to add. For example, you can move directories from "c:\Program Files" to "d:\Program Files" and t

Rumors about real symbolic links in Windows have been swirling since before Win2000.

The problem with Junction.exe is that the Explorer shell and all other applications do not differentiate between links and real folders. That is, applications never expect two different paths to point to the same object, which makes Junctions much less useful in practice. For example, file search results take much longer to complete and display duplicate results. I believe that is why they initially limited Junctions to just directories.

Even more annoyingly, if you "delete" a junction point directory through the shell it will do a recursive delete just as it would for a folder, thus deleting all of the contents of the junction's target directory. If you set up the junction point then this is expected, but if it's someone else who isn't familiar with the concept they can easily mistake it for a bunch of duplicate files (since the shell displays them identically, and gives misleading disk usage information) and delete both copies.

Symbolic links make the Unix file system non-hierarchical, resulting in multiple valid path names for a given file. This ambiguity is a source of confusion, especially since some shells work overtime to present a consistent view from programs such as pwd, while other programs and the kernel itself do nothing about the problem.

NT *was* going to have executables that pretended to be files, i.e. when you opened the executable to get the contents it would run and return the output rather than the by bytes of the executable, with a special NT syscall to read the *real* contents. Kind of like a named pipe. I was looking forward to this but it didn't work out.

Well one could argue that scrapping symlinks was a really bad idea. Yes they can lead to messy filesystems if they are used in a bad way, but they are also the only way to solve a myriad of problems. For example, i have dozens of webapps deployed in their own directories, and they all need a configuration file in a their own directory. Since this config file is the same for each webapp, it certaily makes a lot of sense to have the file be a symlink to a real file somewhere else, in a kind of meta directory.

Symbolic links make the Unix file system non-hierarchical, resulting in multiple valid path names for a given file.

You're confused. Files in Unix filesystems have no hierarchy, with or without symbolic links. Files are quite independent of file names. Multiple directories may contain entries for the same file, the names need not even be the same. The same directory may reference the same file with multiple names. Note for examples that renaming a file changes the modification time of the/directory/, but not of the file.

Symbolic links are a bit of a hack though, yes. But mostly because they must expose the limitations of "files are not the same as filenames" - not because they allow multiple paths to the same file.

Then either he is confused, or it's a deliberate oversimplification. The former is impossible obviously;), however the latter is a trap to the uninformed reader.He never mentions hard-links at all, with which the namespace remains quite hierarchical and cycle-free. Symbolic links suck not because of the multiple-name thing, but because they're an implementation hack that both can turn the namespace into spaghetti and produce inconsistent results across applications due to how exposed their guts are to appl

There have been soft links in ntfs since at least w2K, and probably NT4. I believe they're called junctions in the NTFS jargon. You need the administrative tools to be able to create them. And at least now they're kinda problematic in the sense that there is no way to distinguish them from real folder or files ince they've been created unless you bring up cmd.exe and check with junction.exe if they are indeed symlinks. So it would certainly be a good idea to integrate them better and have them in the main r

... getting to Vista and coming from FOSS or *nix. Apple demostrated that incorporating free software has lots of advantages without hurting sales much, if at all.
And Microsoft, with its stance on patents vs copyright in software, already demonstrated it can do shameless 180 degree turns.
Microsoft: how much can you trust us today?:) Gates on patents [corante.com]

The Unix guys finally figure out how to move past symlinks to something better (private per-process inherited namespaces and bind() overlay mounts ala Plan 9 - coming to a Linux box near you soon), and now Windows starts implementing it for the first time (well.lnk links were kinda like half-baked symlinks, so they were halfway there before this announcement anyways).

...now how about they get rid of this god-awful heirarchy thing they have happening here?
In Windows Explorer, the topmost level is the desktop, while in the CLI, there's as many 'topmost' levels as there are drives in the machine.
I never thought I'd say this, but I think they should adopt a *nix-like heirarchy, so that anything can be 'mounted' anywhere. Of course, they'd have to change the structure significantly, and have a built-in translator for "C:\things\stuff" type commands and whatnot.

1) When you move a destination object, symlinks don't follow the target. This leaves "broken" symlinks that refer to nothing. Why doesn't the mv command move these too?

2) When you symlink a symlinked folder, the root symlink is ignored. Let's say you symlink/usr/tunes to/usr/local/tunes. Later, you symlink/usr/local/tunes/YMCA.mp3 => ~/my_favorite_song.mp3. Now, you have a symlink that relies on both the existence of "/usr/tunes/" AND symlink "/usr/local/tunes >>/usr/tunes". Thus, while deleting 1st ("/usr/local/tunes =>/usr/tunes") symlink doesn't actually delete anything, it does cause ~/my_favorite_song.mp3 to become unworkable.

3) Symlinks cause all kinds of weirds around chrooted file systems, especially ones on a different underlying filesystem. If you're not very careful, nothing is as it seems! Files go nowhere, files are accessable only sometimes, etc. It's logical when you understand and appreciate a symlink for what it is, just a referral, but it can be maddening when security contexts get distorted around a chroot...

The only way to really improve on symlinks is to get rid of file systems, and use a database instead. Symlinks are useful for simulating database views anyway.

The purpose of using a computer is to manage information, and not binary data. Files are relics of the past. Operating systems should have databases for managing persistence. Benefits whould be tremendous:

Yes, the Mac OS had none of those problems with Aliases. I guess that's what happens when you design an OS from the ground up that doesn't use paths to reference everything. In fact, for a very long time there was no way to get a path in the Mac OS. OS X changed all that and now many programs are very fragile (like Preview).

I remember architecting a product to implement all unix based functionality in NT (IPC, memory mapped files, etc) and found NT40 to have that and more. Thats the time I really appreciated windows as a OS more mature than Unix.

The unfortunate part is people still think of DOS/Win95 code base when they think of windows. As a OS, W2K is much more mature in terms of the facilities they offer and as a filesystem, NTFS is way ahead.

Give me a feature in Unix and Im sure there is an equivalent in NT. Thousands of smart people working at Redmond are not idiots and millions of corporate architects proposing NT based solutions are not stupid either. They propose windows based technologies not just for looks (though end users do appreciate that).

and of course the plain old short cuts that are really symbolic links in the traditional unix world.

Try sharing that shortcut over Samba. Didn't work you say? Then, absolutely nothing UNIX-like about it.

The unfortunate part is people still think of DOS/Win95

I use Windows XP and it still has lots of shortcomings. However it's multimedia support is waay ahead of Linux, and I use my machine mainly for multimedia. So whatever criticism I may serve, that's based on WinXP and modern Redmond-OSes.

Give me a feature in Unix and Im sure there is an equivalent in NT.

Kernel and network support loading before the GUI?
You'd think any serious server-OS would implement this...

Possible to recover the system without a GUI if needed?
A reinstall with the textmode interface doesn't count.

Shortcuts are just ordinary files that, when opened, open the location it points to. A symlink, however, allows you transparently access it as though it were the actual file/folder; "C:\Shortcut to porn\hot lesbian action.jpg" won't work, whereas "C:\Symlink to porn\hot lesbian action.jpg" will. See the Wikipedia entry [wikipedia.org], for more info.

Perhaps you should of read the article, especially the bit "how is this different from a shortcut?"

The basis of it is that a shortcut is just a file - the exact same thing as a shortcut can be achieved by having a file with the target path just written in ascii inside, and assuming that the reader can tell it's a shortcut then it could get the target path sure, but if the reader is not equiped to specifically handle those shortcuts then it'll get muck.

A symlink masquerades as the actual file or folder, and the app doesn't need any specific handling to read the file. You can for example go into bash and write "cd symlink/" and it'll go to that folder. A shortcut is just a file, a symlink is an attribute of the filesystem.

When shortcuts were invented for Win95 the Win32 API should have been built to treat a shortcut as the object it pointed to. That way they would have had real working links up front. Now they are going to be stuck with two types of link which work in different ways.

does the average user *really* need them? I certainly can't remember ever having said 'Damn, I wish this piece-of-crap-OS would support symlinks' during my Windows days.

Man, you need to use symlinks to see how useful they are. As someone pointed before, symlinks are great to create compilations of files on a directory. Also, they are very useful if you want to use different types of libraries (DLLs) on different programs (in different directoires).

Bullshit. Most unix software is not aware of symlinks because it doesn't have to be. Generally, only system utilities care about the existance of symlinks. The OS will detect an attempt to open an infinitely recursive symlink.

>Any de1cent OS will detect an attempt to infinitely traverse a symlink, but what's it>supposed to do?>It can:>> * Close the program (= Possible data loss)> * Slow the speed at which the program is allowed to access certain files (= Increase>the chance of race conditions, sometimes by a lot. It doesn't really solve anything>either)> * Make the symlinks "disappear" after a certain level of recursion (= Inconsistent data)> * Do nothing (= Solves nothing)WTF.....

Microsoft brought this on themselves by running around calling themselves "innovative" pretty much several times per sentence during the anti-trust trial, and then continuing with an ongoing PR campaign that still today tries to paint them as being a truly "innovative" company. If you go call yourself innovative, and then proceed to produce a new "modern" operating system for 2006/7 whose primary advancements are all features that were commonplace in many other products anywhere from five up to nearly thirt

A symlink is a hack (as many others have mentioned) that relies on pathnames to find a file. This is almost criminally STUPID, since if the file is moved or renamed, the link will break. If any of the intervening folders change, it will break. All sorts of fragility has resulted ever since where things cannot be moved or else links will break.Mac OS X (and all the way back to System 7 in 1990) did it right by creating aliases which use a two-factor plan to locate its target: