Surely there is not
this is because..if
something (for example, the program itself) can alter the file, then there is
a way to alter the file and the problem is then to prevent any other user from using that way. And as you might guess, there is no way of doing this water-proof; if such a way existed (apart from not having the machine at all), we wouldn't need to worry about hackers or crackers. But we do.
You could set the bit who's-name-I-don't-remember, that prevents anybody from changing the file (was it "u-bit"?), and unset it while the program touches the file. This method, anyway, has the weakness that a mad hacker, a cracker, would only need to find a way to gain root privileges to breach your fine system. It might be difficult, but never impossible