Park and others!.....Possible memory bug in Ruby? I'm stumped!


Yes, you answered my question! Thanks!



-----Original Message-----
From: Hal E. Fulton []
Sent: Sunday, June 09, 2002 8:20 PM
Subject: Re: Park and others!..Possible memory bug in Ruby? I’m

----- Original Message -----
From: “Kurt Euler”
To: “ruby-talk ML”
Sent: Sunday, June 09, 2002 10:11 PM
Subject: RE: Park and others!..Possible memory bug in Ruby? I’m stumped!“./output/”+field[0],“w+”).write(content2)

Because an error occured here in one test, it appears that this
line, like those before it, may also create an OS file. If this
is true, is there way to rewrite THIS line to force a close the
file during or just after the line executes? Or, perhaps
immediate garbage collection occurs with this
command, so I needn’t worry.


Not sure I understand all your constraints, since I haven’t
closely followed this thread.

But be aware that ‘open’ is essentially the same as ‘new’ except
that it can take a block. If it’s given a block, the file will
be closed after the block is executed.“./output/#{field[0]}”, “w+”) { write(content2) }

file is now closed

Does this help any?

By the way, my change to the file name is irrelevant… I just
wanted to illustrate a potentially clearer way of doing that

Hal Fulton