From: Brian Candler Date: 2009-05-17T02:22:45+09:00 Subject: Re: $0 is truncated Yukihiro Matsumoto wrote: > Hi, > > In message "Re: $0 is truncated" > on Sat, 16 May 2009 22:03:36 +0900, Brian Candler > writes: > > |If I assign a new value to $0, I find it is truncated. > > Platform info please. On some platforms, changing program name (as > seen from ps for example) is limited to the original size. We cannot > relax OS limitation. This is under Linux (Ubuntu Hardy). Yes, I'm aware that maybe setproctitle has limits, but it's also useful to set $0 to a longer Ruby string (even if that's not fully reflecting in the proctitle), because another piece of Ruby code in the same process may be testing the value of $0. In ruby 1.8.6, I can use $0.replace("any long string") which works just fine for setting $0 - presumably not setting the proctitle of course. But this stopped working in 1.8.7/1.9 because $0 is frozen. Regards, Brian. -- Posted via http://www.ruby-forum.com/.