bash: permission denied...(after it allows me?)

view full story

http://www.unix.com – I'm sure this question comes up a lot, but I'm particularly confused in this situation. I can run my program once, just fine. However, if I try to run it again without recompiling, bash refuses to give me permission. I have a small idea why, but I don't think think I'm right. Here's what I'm doing (for a course assignment). I have a program that has to change itself during runtime. The easiest way I thought to do this would be to to add blank lines to the executable, by creating a file with a few "\n" in them, and then concatenating them using a system call. It works! But only (HowTos)