# I can't read correct filesize of an 12 GByte file

**URL:** <https://www.ruby-forum.com/t/i-cant-read-correct-filesize-of-an-12-gbyte-file/100904>\
**Category:** Ruby\
**Created:** [August 1, 2006, 10:13pm UTC](https://www.ruby-forum.com/t/i-cant-read-correct-filesize-of-an-12-gbyte-file/100904 "2006-08-01T22:13:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akejohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/58f4c7/32.png) [@akejohan](https://www.ruby-forum.com/u/akejohan)\
**Post date:** [August 1, 2006, 10:13pm UTC](https://www.ruby-forum.com/t/i-cant-read-correct-filesize-of-an-12-gbyte-file/100904/1 "2006-08-01T22:13:19Z")

</div>

I am trying this program but I get the wrong file size?

sf = File.size(‘D:\DVD\_CAPTURE\uvs040114-003.MPG’)  
puts sf

The file I try to read the size of = 12 152 090 kB is uvs040114-003.MPG

This simple test program prints -441161728 is there a bug?

It should print 12 152 090 000 bytes.

Have I missed something??

Best regards  
Ã?ke Johansson

---

<div class="post-metadata">

**Author:** ![akejohan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/58f4c7/32.png) [@akejohan](https://www.ruby-forum.com/u/akejohan)\
**Post date:** [August 1, 2006, 10:49pm UTC](https://www.ruby-forum.com/t/i-cant-read-correct-filesize-of-an-12-gbyte-file/100904/2 "2006-08-01T22:49:43Z")

</div>

Ã?ke Johansson wrote:

> Have I missed something??
> 
> Best regards  
> Ã?ke Johansson

require ‘win32/file’

It should work after you do that. Do gem install win32-file if you  
don’t have win32-file (it’s included with the latest one-click  
installer, though).

Regards,

Dan
