[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: $0 is truncated

Yukihiro Matsumoto

5/16/2009 4:55:00 PM

Hi,

In message "Re: $0 is truncated"
on Sat, 16 May 2009 22:03:36 +0900, Brian Candler <b.candler@pobox.com> 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.

matz.

1 Answer

Brian Candler

5/16/2009 5:23:00 PM

0

Yukihiro Matsumoto wrote:
> Hi,
>
> In message "Re: $0 is truncated"
> on Sat, 16 May 2009 22:03:36 +0900, Brian Candler
> <b.candler@pobox.com> 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-....