Hmm, what would you define as a corrupted file? How would you know if something is corrupt? Since everything in Unix is just a file, I dont think you can say that one file is corrupt vs another file without evaluating its attributes. If its a binary, then running it would tell you that its corrupt when it fails. Capture the return code after its execution. Anything non-zero would imply an issue.
Can you clarify what you mean?

Sure! :-)
This file is a plain text file used for logging (ham.log)
I can tell it is corrupted because:
1) cat ham.log returns: ham.log: Corrupted file system detected.
2) The app that uses it to log doesn't start unless I delete it (it's then able to start and creates another ham.log file)
It gets corrupted when the computer loses power. (the application needs not to be logging at this precise time, but it's running)
Thanks,
Martin

I have never heard of behavior like that. What version of unix are you using?

I would try exactly what you did from the command line in a script. I assume that you are using ksh as your login shell. Since the cat command is detecting the problem, go with that. A well written command will return an exit code. See if your cat does. From the command line:
cat goodfile >/dev/null 2>&1
echo $?
cat badfile > /dev/null 2>&1
echo $?