We have a some files or directories with their absolute paths.
These files or directories will be renamed in a process. We can't get the new names from the process at all, but we have the root directory full name(full absolute path)
Now, I wanna find that items again
Is there a unique key or something for directories or files to find them without the exact name?
Asked
Active
Viewed 76 times
2

Mohammad Dayyan
- 21,578
- 41
- 164
- 232
-
Do you mean like using a MD5 hash to create a unique identifier? – failedprogramming Apr 09 '14 at 05:09
-
@failedprogramming: Yes – Mohammad Dayyan Apr 09 '14 at 05:11
-
Answer by asveikau may help if Id doesn't change during rename... http://stackoverflow.com/questions/7162164/does-windows-have-inode-numbers-like-linux – Mark Setchell Apr 09 '14 at 06:23
1 Answers
6
No, there is nothing directly available on regular NTFS from C# code to do so.
You can
- compute some sort of hashes of files yourself + size check to find them again after rename (if they simply renamed)
- use events from FileSystemWatcher to track file movements
- add alternative streams to files if they will not be stripped by "the process" to use as custom markers.

Community
- 1
- 1

Alexei Levenkov
- 98,904
- 14
- 127
- 179
-
The files or directories may rename or moved within the root directory. – Mohammad Dayyan Apr 09 '14 at 05:15