Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Question about File::Stat and file size

Reply
Thread Tools

Question about File::Stat and file size

 
 
Overdorf, Sam
Guest
Posts: n/a
 
      08-07-2008
I frequently use the File::Stat structure.

I have found the size element is not large enough for DVD's (4Gigs)
because it always comes out as a negative number.

I also use the restart feature of ftp when transferring a DVD image and
find that the Ruby implementation does not support this large of a file
so I can't restart a transfer picking up where it left off.

Does anyone know if this will be addressed in future implementations of
Ruby?

Thanks,
Sam Overdorf
LADV/Intel


 
Reply With Quote
 
 
 
 
Eric Hodel
Guest
Posts: n/a
 
      08-07-2008
On Aug 7, 2008, at 13:53 PM, Overdorf, Sam wrote:
> I frequently use the File::Stat structure.
>
> I have found the size element is not large enough for DVD's (4Gigs)
> because it always comes out as a negative number.
>
> I also use the restart feature of ftp when transferring a DVD image
> and
> find that the Ruby implementation does not support this large of a
> file
> so I can't restart a transfer picking up where it left off.
>
> Does anyone know if this will be addressed in future implementations
> of
> Ruby?


I think the problem is in your operating system:

$ ll big
-rw-r--r-- 1 drbrain staff 17179869185 Aug 7 14:13 big
$ ruby -e 'p File::Stat.new("big").size'
17179869185
$ ruby -e 'p File::Stat.new("big").size.class'
Bignum
$ uname -a
Darwin dhcp-218.coop.robotcoop.com 9.4.0 Darwin Kernel Version 9.4.0:
Mon Jun 9 19:30:53 PDT 2008; rootnu-1228.5.20~1/RELEASE_I386 i386


 
Reply With Quote
 
 
 
 
Eric Hodel
Guest
Posts: n/a
 
      08-07-2008
On Aug 7, 2008, at 14:15 PM, Eric Hodel wrote:
> On Aug 7, 2008, at 13:53 PM, Overdorf, Sam wrote:
>> I frequently use the File::Stat structure.
>>
>> I have found the size element is not large enough for DVD's (4Gigs)
>> because it always comes out as a negative number.
>>
>> I also use the restart feature of ftp when transferring a DVD image
>> and
>> find that the Ruby implementation does not support this large of a
>> file
>> so I can't restart a transfer picking up where it left off.
>>
>> Does anyone know if this will be addressed in future
>> implementations of
>> Ruby?

>
> I think the problem is in your operating system:
>
> $ ll big
> -rw-r--r-- 1 drbrain staff 17179869185 Aug 7 14:13 big
> $ ruby -e 'p File::Stat.new("big").size'
> 17179869185
> $ ruby -e 'p File::Stat.new("big").size.class'
> Bignum
> $ uname -a
> Darwin dhcp-218.coop.robotcoop.com 9.4.0 Darwin Kernel Version
> 9.4.0: Mon Jun 9 19:30:53 PDT 2008; rootnu-1228.5.20~1/
> RELEASE_I386 i386


On a filesystem with sparse-file support (1TB file on a partition with
45GB free):

$ ll sparse-file
-rw-r--r-- 1 drbrain drbrain 1099511627776 Aug 7 14:30 sparse-file
$ ruby -e 'p File::Stat.new("sparse-file").size'
1099511627776
$ df /data
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ad4s1g 55679808 4424840 46800584 9% /data
$

maybe the configure script could not find large file support for your
OS.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Preferred Size, Minimum Size, Size Jason Cavett Java 5 05-25-2008 08:32 AM
Disconnect Between HD File Size & PS's File Size One4All Digital Photography 8 09-12-2007 03:02 AM
File#size and File#size? follow links? John Joyce Ruby 2 04-27-2007 03:10 PM
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
compare file size with online file size tiewknvc9 Java 6 10-01-2006 09:30 AM



Advertisments