"Do my findings point to a problem created by the Kx itself?"
Maybe, maybe not. It certainly is not the camera hardware, but could still be the camera firmware, the card controller firmware, the card controller hardware, or an incompatbility between the camera and the card (soft-/firmware related), meaning a different interpretation of the standard by Pentax and the card manufacturer.
The FAT32 file system is still an expansion of the FAT system developed for early MSDOS - an OS which does not know about file "types" and file "headers". So test tools like H2testw do not compare file type related file headers with FAT entries. If H2testw says OK it means the file system itself does not show an inconsistensy.
My idea was (I may be wrong), that there is an inconsistancy between the FAT data and the header data, which would of course not be shown in H2test, if FAT data in itself are correct. But when writing data to disk then FAT data would be used, allowing another file to hijack some bytes of the next file written. The disk structure would still be OK, but the 1rst file could be corrupt. In this case, if you would repeatedly write files and delete single pictures (including the first one in a directory), also another file could be affected instead of the first one.
I am not sure we will be able to find out the cause by such tests, but the fact that the header (the BEGINNING of the first file) maybe modified could mean I am wrong. It would be interesting to see what happens, if you take just ONE picture with a freshly formatted card, and the same if the card was formatted off the camera. Or, in other words, will the file be corrupted when it is written, or when THE NEXT FILE is written. Also it would be interesting to see, whether these 4 bytes (of the already corrupted file) change after you write a THIRD file to the card.
I have completely forgotten about the internal structure of a FAT, and to update would mean to bury deeply in 15 years old Microsoft operating system handbooks (would have to find them first, maybe in some forgotten box in the cellar). Programming today is too often just linking existing libraries.
EDIT:
It does not make much sense to compare the file sizes shown by the OS of the same file between the card and the HD. The physical structure and data organisation of the data on the card is a top secret of the manufacturers, as it is a main factor for speed and life cycle of such a card. The OS only sees a (virtual) mapping provided by the card firmware, and we don't know about things like real cluster sizes etc. The size in bytes could be rounded to fit into that internal mapping.
Last edited by RKKS08; 11-29-2011 at 01:33 PM.