--jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Gennady Bystritsky wrote: > But you do not even know when GC will be run, so in your case it might Inserting 'GC.start; sleep 1' won't help... > not even have kicked in. On the other hand, IO.popen has a nice block > form that gurantees that an underlying IO object will be closed > properly. You can rewrite your code as: > > os = IO.popen('uname -sr') { |io| io.readlines.to_s.strip } That works, but is longer. Shorter code is more readable in general... Anyway, I think an IO object should be closed when not being needed anylonger. Stephan. --jRHKVT23PllUwdXP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (FreeBSD) iD8DBQFEQ9JOuKMfCHUX8x0RAhn/AJ9bXOnu7fzcXACy+T0buC3CBRkq8ACgmYpu eNhqLPzEcq0u7if03MvTfho 2D -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP--