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 70 times
2
![](../../users/profiles/191647.webp)
Mohammad Dayyan
- 18,338
- 35
- 143
- 207
-
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.
![](../../users/profiles/-1.webp)
Community
- 1
- 1
![](../../users/profiles/477420.webp)
Alexei Levenkov
- 94,391
- 12
- 114
- 159
-
The files or directories may rename or moved within the root directory. – Mohammad Dayyan Apr 09 '14 at 05:15