Making NTFS a Little Bit Friendlier

A while back, I posted in my LonghornBlog about how I wanted to have a file live in several locations in WinFS. A few hours later, I got two comments that I considered fairly condescending, because they just assumed that I knew what they were talking about, and didn't provide any further information (besides that really stupid for not knowing it was possible). Steve Maine, who is a really cool guy, jumped in and talked about a tool from SysInternals, but I could not find it after scouring the site. Disappointed, I blew it off and forgot about it.

When I woke up this morning, I noticed an interesting blog entry from Daniel Cazzulino. What started as a fairly mundane post about XML and Intellisense ended up as the answer I was looking for:

fsutil hardlink create {new filename} {existing filename}

I immediately saw the benefit to this on my web server. I have a sum total of 9 different web projects that all use the same template files to operate. If I make a change to one, I always have to make a change to the 9 others.... after a while it gets really old. Due to limitations of my skinning system, ASP.NET, and IIS, I can't have these files in virtual directories. VS.NET won't let you edit files that are in virtual folders in a web, so you're stuck there too. It looked like I had finally found my answer.

Well, I started setting up the system. I created a folder outside of my regular website tree that would store the skins, and started recreating the directory structures. Having completed that, I started to copy the files over. I had to enter each file into the command prompt manually. 40 template files * 9 folders + short attention span = no chance in hell [how's that for math ;) ]. So, I whipped up a quick-and-dirty little application to give my attention span a break. And the result is:

I got to learn all the nuances of the ProgressBar control, browsing for directories, and the like. It was a lot of fun, and great to see it actually work when it was done. It doesn't do any directory recursion or anything like that, but it does what it's supposed to, and that's always a good thing. Screenshots of the post-execution file system are below:


Don't let your eyes deceive you. Those files are not duplicates, they are linked. The originals remain in the “C:\test” folder, and the “C:\test2“ folder contains the NTFS equivalent of a hyperlink. If you change a file in one directory, and open it up from the other, you'll see the same changes. I'm going to go into more detail about how it works in a few days, but for now I wanted to whet your whistle. I'm going to release it as a free product, probably the first part of next week. I want to add directory recursion, logging, and a few other options before I make it public, and I still have to make a User's Guide and an installer. It took me about 3 hours to write (wasted about 90 minutes trying to get Logging working on the prototype.... stupid shell commands) but it will save me countless hours managing my network of websites later on.

I'll post links when it's available to download. In the meantime, tomorrow evening I'm launching a new version of InterscapeUSA.com (the skin consolidation was basically the last step), along with another free product that I haven't talked about yet (but I alluded to last week, for those of you paying attention). I had the awesome pleasure of working with Jamie Cansdale of NUnitAddin fame, and this is the first of many projects we'll be collaborating on together. I “strongly“ think a lot of people will find it useful. ;).

Alright, off to bed for me. Big day tomorrow.

3 Comments

Comments have been disabled for this content.