On Mar 24, 2004, at 1:29 PM, walter / mwsewall.com wrote:

> <snip>
>
>> It looks like a bug (that is, it doesn't happen that way on my
> box).
>
> Is it a windows or *nix box?  and can you read files over 4 gigs in
> size?

It's a mac, so it's a *nix box.

>
>> I'm guessing that it's a signed <vs> unsigned integer problem. When it
>> wraps around, does it start out at negative one and go upward fro
>> increasing file sizes?
>>
>>> Is there a work around?
>>
>> try:
>>    [File.stat("filename").size].pack("i").unpack("I")
>>
>
> Thats cool and does work for files less than 4 gigs but (obviously)
> fails for larger files.

whoops :/ I didn't think about that until I read your followup posting 
where you said 14 gigs...

Okay, new workaround! :) Open in append mode, read the position.

  >> File.open("/Users/mark/bigfile","a"){|f|f.pos}
=> 12006195200

Does that work?

--Mark