| View previous topic :: View next topic |
| Author |
Message |
mikeholmes Newbie
Joined: 25 May 2004 Posts: 5 Location: Lincoln, England
|
Posted: Mon Oct 18, 2004 9:10 am Post subject: File size returned by @file is negative! |
|
|
| I am using vds3.51 and have found that the @file function returns a negative file size in bytes when using the Z option with a large file. It works fine on a 1500Mb file but with a file of 2291Mb I get a negative number -1948598102. Have I hit a max file size problem, or a bug, and is there any way round it? |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon Oct 18, 2004 11:06 am Post subject: |
|
|
It looks to me as if VDS 5 might have the same problem, because the data structure that returns the file size is a 32-bit integer, which limits the maximum size it can handle to 2GB. (Can anyone verify this? I don't have any files that big.) Since you're getting a negative number, you can work around the problem for files up to 4GB by using floating point arithmetic to add this negative number to 2^32.
It is unlikely that this issue can be fixed in VDS 5, because it has been developed using a tool that doesn't support larger than 32-bit numbers. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
mikeholmes Newbie
Joined: 25 May 2004 Posts: 5 Location: Lincoln, England
|
Posted: Mon Oct 18, 2004 12:00 pm Post subject: |
|
|
Thanks for your quick reply Jules. That was what I suspected. Since the file is just over 2Gb I have used your workaround to keep me going. I'll have to look at ways of getting the file size information from outside of vds - ironically I only need it to the nearest Mb.
Thanks
Mike |
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
|
| Back to top |
|
 |
|