I'm pretty sure it's just a computer gremlin corrupting the files. A simple solution would be to spray some sort of repellent into any intake fans on your Mac. If there are no intake fans, then you could try making a program to constantly create empty text files in a certain directory in hopes of keeping the computer gremlin busy. In a worst case scenario, however, you'd want to format your hard drive and light your computer on fire and put it out with holy water, chanting "Begone demons of the virtual realm, I banish thee!"
You can find holy water at any local drugstore, but if you don't have a local supplier, Walmart has an off-brand "Good" Water, which is almost the same thing.