I want to work with Hard Links.the windows's NTFS filesystem support hard file links. but i found the hard link no longer valid after a few modification and saving. This must be that some one called DeleteFile to delete the hardlink,and recreate it by createfile. I thought it it vc that do this,but i'm wrong. when I use a debugger to break at DeleteFile,I found that it is visual assist who do this silly work. why do u do THIS???? 0012F5EC 1ED0EFFC /CALL to DeleteFileA from va_x.1ED0EFF6 0012F5F0 02959440 \\FileName = "D:\\cpp\\dll\\dll.cpp" 0012F5F4 02959440 ASCII "D:\\cpp\\dll\\dll.cpp" 0012F5F8 5084482D RETURN to devedit.5084482D from va_x.1ED0EFF0 0012F5FC 02959440 ASCII "D:\\cpp\\dll\\dll.cpp" 0012F600 00E86380
While not acknowleding the specifics of your example, we will say VA X deletes and creates many files during its execution. We cache files, maintain working copies that we load/unload from the editor window, etc.
Hmm, using DeleteFile indeed looks wrong. Since I don't see any of my source files missing because of VAX ;) I assume that when you delete a file you immediately move/copy a new one to its place. In this case fixing the hard links issue is easy: just overwrite the file programmatically instead of using things like DeleteFile/CopyFile (or whatever you use).
DeleteFile/CopyFile deletes the hard link and creates a new file (if called on a file that has hard links, that is). Using stuff like CreateFile/ReadFile/WriteFile you would preserve the hard link and change the original file instead of creating a new one.