=begin
I am sorry if this duplicated on ruby-core. I wanted the redmine ticket updated. It also gives me an opportunity to correct some grammar.
This is a valid point and I now understand that this isn't 100% reliable. Just "most-of-the-time" reliable.
Furthermore cwd one can't fake. And the other argv values one can't fake. So as with other things in life, I propose we say, "yes there are exceptions, so programmer beware" and then try to be helpful. This is nicer than taking an approach that because we can't get it to work in all conditions, we're not going to do anything. Programmers will still have to solve their problems, and without this will do so even less reliably but with more effort.
I think that "faking" $0 beforehand is more of the exceptional case than the normal case. And as you suggest, it can't be done on all operating systems.
But in my particular application, it doesn't really matter.
In the ruby debuggers I work on, you can see what the debugger has recorded to restart. That command is called "show args". So if you've run argv0, the programmer can change the settings presented with "set args". If it makes a difference.
I put this all in the context of a debugger to make things concrete. But one may imagine other situations in writing a large system where one may just want a simple way to restart the program or suggest how the program was invoked, keeping in mind argv[0] might be different.
=end