title: How to get file MFT entry/inode using Java or C++
body: <p>I've written a duplicate finder in Java, but I need to include hard link support for it. Unfortunately, there seems to be no way to dig out a file's MFT entry in Java.</p>
  
  <p>Although there is a method called fileKey() in the BasicFileAttributeView class, it won't work on the NTFS file system (I haven't tested it on ext yet).</p>
  
  <p>I also found the method <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#isSameFile" rel="nofollow noreferrer">isSameFile()</a> (in java.nio.file.Path). Does anyone know how this method works? It seems to be doing the right thing, but it returns a Boolean value, so it is worthless for me (I wish to put the results into a map and group them by their MFT entries).</p>
  
  <p>I can always compare the creation times, modification times, etc. for each file, but this is just giving up.</p>
  
  <p>Is there any way to accomplish what I am trying to do in either C++ or Java? I care more about making it work on NTFS than ext.</p>