Comparing timestamps / file size not reliable in editor

I’m working on an editor tool and I have a function where I check if any images have been changed using timestamps and file length. Problem is, the .Net functions completely fail to give me up to date information. It seems to be giving me old cached data every time I make a call no matter what method I use.

I’ve tried:
File.GetLastWriteTime(path);

FileInfo fi = new FileInfo(path);
fi.Refresh();
lastWriteTime = fi.LastWriteTime;
length = fi.Length;

using(FileStream fs = new FileStream(path, FileMode.Open)) {
length = fs.Length;
}

lastWriteTime = TextureImporter.GetAtPath(path).assetTimeStamp;

Not one of the above 4 methods of getting last file write time or file size works properly. Neither file length nor file write time are updated on any reliable schedule. Sometimes closing Unity and reopening it will clear the cached data and my tool can detect an update, but many times even that doesn’t work. All I can find is that it may have something to do with Windows and virtual memory, but that seems like something that would be handled by .Net.

The same BUG