forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


File size returned by @file is negative!

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
mikeholmes
Newbie


Joined: 25 May 2004
Posts: 5
Location: Lincoln, England

PostPosted: Mon Oct 18, 2004 9:10 am    Post subject: File size returned by @file is negative! Reply with quote

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
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon Oct 18, 2004 11:06 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mikeholmes
Newbie


Joined: 25 May 2004
Posts: 5
Location: Lincoln, England

PostPosted: Mon Oct 18, 2004 12:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Fri Aug 05, 2005 1:11 am    Post subject: Reply with quote

Is it possible to use the GetFileSizeEx API call? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getfilesizeex.asp

If so, has anyone done it and can post their code?

Cheers.

_________________
John Trappett
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group