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 


Get filesize, but now the the right one...

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


Joined: 24 Apr 2002
Posts: 72

PostPosted: Tue Nov 30, 2004 8:33 am    Post subject: Get filesize, but now the the right one... Reply with quote

Hello,

I've made a little application that uploads files to a database. The files will be uploaded in chunks of 4096 (or another size) bytes, but the only problem is that the files will only be uploaded when the rest is not 0.

So when a files has a filesize of 122880 bytes, it is divadable by 4096 (122880/4096=30) and the rest will be 0... result: the file will nog be uploaded.

So when the filesize is divadable by 4096, I want to set the chunksize to 4095 bytes, because 122880/4095=30 and the rest is 30 bytes. Result: the file will be uploaded.

But now the problem... When you look at a file you can see 2 different filesized. The real filesize and the filesize on disk. The problem is that when I use @FILE(<filename>, Z) I get the real filesize, but I need to get the filesize on disk because the external application that uploads the files divides the filesize on disk by the chunksize (4096, 4095, or whatever...).

Is there a way to get the filesize on disk in VDS 3.5?

Thanks in advance,
Raymond
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


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

PostPosted: Tue Nov 30, 2004 8:50 am    Post subject: Reply with quote

I think the file size on disk is the next largest multiple of the cluster size. So you need a way to find out the cluster size.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Raymond175
Contributor
Contributor


Joined: 24 Apr 2002
Posts: 72

PostPosted: Tue Nov 30, 2004 9:06 am    Post subject: Reply with quote

Het application will only be used on 1 computer, so I can set the clustersize hardcoded into the application. How do you know what the clustersize is and how can I calculate the next largest multiple of the cluster size?

I will go and calculate myself too,
Raymond
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


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

PostPosted: Tue Nov 30, 2004 10:36 am    Post subject: Reply with quote

If you know the filesystem and the partition size you can find out the cluster size. I don't know what it is but it is documented. The information is probably on the web. Some system information tools may give this information, as well.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
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