Maybe your original code was writing to the file, but only a few
characters; and because the file handle was never closed, the buffer
was not flushed and the output written?

It's happened to me in other languages.  I don't know whether Ruby
would behave like that.


On Wed, Jul 30, 2008 at 9:29 PM, Thomas Luedeke
<thomas.luedeke / areva.com> wrote:
> Gregory Brown wrote:
>> On Wed, Jul 30, 2008 at 4:19 PM, Gregory Brown
>> <gregory.t.brown / gmail.com> wrote:
>>>
>>> something=false
>>>
>>> then
>>>
>>> if(something) is the same as if(something == false)
>>
>> Sorry, I totally have confused myself (but hopefully not you).
>>
>> What you're looking for when you do
>>
>> if(something == false)
>>
>> is either
>>
>> unless(something)
>>
>> or
>>
>> if(!something)
>>
>> My point was that you don't need to explicitly check against a
>> boolean, but then I made things much more confusing.  Sorry for the
>> triple post!
>>
>> -greg
>
>
> Actually, your explanation of the loop closing the file handle makes a
> lot of sense regarding what I was seeing.  I also did not know Ruby did
> that.
>
> In fact, in my newbie meanderings, I seem to recall that if I put a
> File.close outside of a loop just like that one, it always spawned an
> error.  No wonder.
>
> Thanks so much for your help!!  I'll have to dig out my Ruby book and
> read up on file handles.
> --
> Posted via http://www.ruby-forum.com/.
>
>



-- 
Me, I imagine places that I have never seen / The colored lights in
fountains, blue and green / And I imagine places that I will never go
/ Behind these clouds that hang here dark and low
But it's there when I'm holding you / There when I'm sleeping too /
There when there's nothing left of me / Hanging out behind the
burned-out factories / Out of reach but leading me / Into the
beautiful sea