<p>Programs that index filesystems seem to know which parts have changed since their last index and only rescan that part. How can I determine where the filesystem/files have changed since my last index. Don't care what language you answer in but I'm thinking c and windows.</p>

<p>An example of such a program is Sequoia View which generates a treemap of your hard disk.</p>

A fairly simplistic method would be to take the file system's reported files sizes, dates (as integer values), and file names in a given directory and calculate a
checksum
you could then associate with that directory.  You would still need to perform this calculation on all of the directories using file system data  but you wouldn't have to go in depth (opening files to check for differences) unless a checksum reported a difference.
For tracking specific changes at the file level you would store checksums based on individual file attributes, and of the course the presence of or absence of files and subdirectories since the last scan.
This wouldn't necessarily guarantee that changes have not occurred as there are file system utilities for altering all manner of attributes though it would be a good first step for a basic scan.
You may find the
source code
for
fswatch
helpful.