This question already has an answer here:
- Code that will only execute once 75 answers
Create a program that, when run, changes the contents of the source file. This means that you can delete/add/change characters in the source file, but you can't delete the (source) file itself (deletion is when the source file does not exist after the program is run).
In the case of pre-compiled languages such as C++, your program can change the source file only, such that when compiled, either fails or does not produce the same result.
Your program must not return any errors, such as access violations (e.g. opening a file that is already open).
- This is an advantage to pre-compiled languages, as the source file does not have to be in use to run it.
You may take an optional path to the source file, but nothing more.
You may output anything.
This is code-golf, shortest answer wins!