| View previous topic :: View next topic |
| Author |
Message |
Raymond175 Contributor


Joined: 24 Apr 2002 Posts: 72
|
Posted: Tue Nov 30, 2004 8:33 am Post subject: Get filesize, but now the the right one... |
|
|
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 |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue Nov 30, 2004 8:50 am Post subject: |
|
|
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 |
|
 |
Raymond175 Contributor


Joined: 24 Apr 2002 Posts: 72
|
Posted: Tue Nov 30, 2004 9:06 am Post subject: |
|
|
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 |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue Nov 30, 2004 10:36 am Post subject: |
|
|
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 |
|
 |
|