![]() |
Languages »
C# »
Applications
Intermediate
License: The Code Project Open License (CPOL)
HardLinks - Manage your library of common classesBy Nick ButlerA tool for managing NTFS hard links |
C#.NET 1.1, Win2K, WinXP, Win2003VS.NET2003, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||

I have some classes that I reuse in many projects. I wanted a way to share these files between projects, while always updating a "master" copy that is the latest version. The NTFS support for hard links seems to be an answer. I can now keep all the master files in one directory, and link to the files I want to use from individual projects.
NTFS hard links allow a file to appear in more than one directory with more than one name. Unix users will be familiar with this concept.
Because this can get very confusing very quickly, I have assumed some rules.
You should now have your real and link file directories selected in the list boxes on the left, and the Cursors.cs file in the checked list box on the right.
You now have the link to the real file in your project.
This may seem a bit complicated, but it gets easier as you add more common files.
The checked list box on the right lists all the files in the selected real directory. The check state indicates the files in the link directory.
You can see the Legend from the context menu, but here are the states and their meanings :
Be careful not to delete real files!
This applies to icon files especially, as Visual Studio overwrites them when you edit them, instead of just updating their contents. If you have to edit an icon file, then manually select the file in your real file directory, or you will just make a copy in your link file directory which is what we're trying to avoid.
The code is not very interesting. It is mostly GUI stuff, but I have included it in case you want to modify it.
I have included this app in the zip files. It is an optional install with Visual Studio - under C++ Tools I seem to remember.
Point to the exe in the Options, or just put the exe in the application directory and you can immediately compare the currently selected real and link file directories.
I used the Magic Docking Library by Phil Wright. It made life very easy, so I give it a 5.
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 5 Mar 2004 Editor: Nishant Sivakumar |
Copyright 2004 by Nick Butler Everything else Copyright © CodeProject, 1999-2009 Web10 | Advertise on the Code Project |