Check if the content of an SD card was changed or not

Hi All!

I want to raise an interesting questions. I want to check if the content of the SD card was changed or not. Off course if this change was done by my running application than there is no questions how to do that. But what if some windows process changes the content my exposed SD card. (Via USB).

My first idea was to check the free spaces of the the device. If this was changed that means that the content was changed. But what if somebody deletes a 25kb file and copies a 25kb file to the device. The free spaces remain the same. Or what if somebody just open a file and change a single character. Than the free spaces remain the same.

So, there is way to catch this kind of changes?

Thanks,
Platini

If it is a windows application you can use FileSystemWatcher classe :
FileSystemWatcher Classe (System.IO) | Microsoft Learn . But it is not available for micro framework.

modify date/time would be the trigger in a desktop/server environment but i think this has a different behavior with the GHI file system to work around limited writes on serial flash (i did read something some where but don’t remember where…)? GHI?

Hmmm… maybe you could iterate through all the characters in the file and create a checksum or something?