detect database file size

AccessProgram

Registered User.
Local time
Today, 09:56
Joined
Dec 7, 2009
Messages
68
I am using filelen, LOF and FileSystemObject to get the size of the access database. They get similar result however, for example my database in the windows explorer says 4864 kb, the function will give result as 4,980,736 which is 4981 kb. There is the difference of 117.

What is the right result there? Result from the function or result seen in the windows explorer?

Is there any function that would return the right size?
 
What do you consider a kb to be; 1000 bytes or 1024 bytes?
When does it make a difference to you?
 
1000 bytes = 1 kb

When does it make a difference to me? I want to get the exact database size of the access db. The purpose is to collect the record of the increment from the previous to current database size which will inform the user that the database has increased by this value.
 
Then use LOF because it is returning the correct number of bytes in the file.

A kb can be 1024 bytes because 1000 needs 10 bit of binary to store the value.
But 10 bits of binary can also store 1024, so there is a difference.
LOF will return the correct length.
 
ok.

I havent tested the LOF, filelen and filesystemobject more than twice, but base on my 2 test conducted, the result between the three where the same. But you suggested to use LOF. Do you mean in the long run and more tests, LOF will return the most accurate correct length in bytes?
 
>>Do you mean in the long run and more tests, LOF will return the most accurate correct length in bytes?<<

No, I mean LOF will return the correct length of the file.
 
>>Do you mean in the long run and more tests, LOF will return the most accurate correct length in bytes?<<

>>in the long run<< was a needles qualifier.
>>more tests<< was a needles qualifier.
>>the most accurate<< was a needles qualifier.

LOF will return the correct length of the file.
 
i just mention those qualifiers because I have 3 functions to get the size value in bytes and I wanted to know if there will be difference in the result if between the 3 for more test to be conducted.

Anyway, LOF will already suffice. But I will do more test between the three. thanks
 
Just as a matter of some interest…
If we want to work with computers we have to start thinking like the bastards.
When we start thinking like the bastards we can generally find the answer in the question.
 
my database in the windows explorer says 4864 kb, the function will give result as 4,980,736 which is 4981 kb. There is the difference of 117.

A file of 4,980,736 bytes will show as 4864 KB because in Microsoft file sizes a KB is 1024 (2^10) bytes. This also the case with RAM.

However in data transmission rates or disk capacity, a KB (kilobyte) or Kb (kilobit) means 1000. This is also the case for file sizes in Linux and OSX.

This difference is the reason an "80 GB" hard drive (GB = 10^9 bytes) shows in Windows with a capacity of less than 75 GB (GB = 2^30 bytes).
(Check it out in the properties of your hard drive.)

A peculiar anomaly was the 1.44MB floppy disk.
This was based on 1 MB = 1000 KB and 1KB = 2^10 bytes.
 
A file of 4,980,736 bytes will show as 4864 KB because in Microsoft file sizes a KB is 1024 (2^10) bytes. This also the case with RAM.

However in data transmission rates or disk capacity, a KB (kilobyte) or Kb (kilobit) means 1000. This is also the case for file sizes in Linux and OSX.

This difference is the reason an "80 GB" hard drive (GB = 10^9 bytes) shows in Windows with a capacity of less than 75 GB (GB = 2^30 bytes).
(Check it out in the properties of your hard drive.)

A peculiar anomaly was the 1.44MB floppy disk.
This was based on 1 MB = 1000 KB and 1KB = 2^10 bytes.


This is NOT quite right... There is a difference between KB, Kb and kB
It used to be only one, KB, for Kilobyte...
Old fashioned style maths as well as some fancy marketing leads to big differences in 'optical' speeds,
1 bit,
1 Byte (2 ^ 3 = 8 bits),
1 KB (2 ^ 10 = 1024 Bytes (or * 8 = 8192 bits) )
1 MB (2 ^ 10 KB = 1024 KB, or (2^20) 1.048.576 Bytes or 8.388.608 bits)
1 GB (2 ^ 10 MB = 1024 MB, or (2^30) 1.073.741.824 Bytes or 8.589.934.592 bits)

Windows is still going by this "original" system and is the "right" way of doing things IMHO.

Now a days ...
1kB = 1000 Bytes
1mB = 1000 kB, 1.000.000 Bytes
1gB = 1000 mB 1.000.000 mB, 1.000.000.000 Bytes

The names have swapped, gB is now GB for Gygabyte as we all know it. The 2^30 bytes for gB is now called not a Gygabyte but gibibyte.

Note that this is gB with small g big B, big B being BYTES. Now go to your ISP and find your indicated speed, guess its likely it will say 20 Gb for 20.000.000 bits, not bytes this is a very common misconception so you have devide that by 8, 2.500.000 Bytes then devide that by 1024 and again by 1024 gives us 2.38 gB (or "old fashioned original" Gigabytes (now gibiBytes). How are you being "stolen from" is compare 20 gb to the 20 gB
20 gb = 2.500.000 bytes
20 gB = 21.474.836.480 Bytes (old fashioned Gigabytes, now gigiByte)

This is why 400 GB, translates into 372 gB

The swap between GB and gB went very quietly by mainly Harddrive manufacturers to "give more for less" , then the gb sneaked in because 20 gb just looks a lot better to sell than 2.5 GB or really gB for ISPs...

I hope that gives more answers than create questions :eek:
 
silly question - but why would the file size be of any siginificance at all
 
The names have swapped, gB is now GB for Gygabyte as we all know it. The 2^30 bytes for gB is now called not a Gygabyte but gibibyte.

Although there is the new set of binary terms I have yet to see anyone use them other than to quote the official story. Anyone seen a computer advertised with 2 Gibibytes of RAM?

It is a bit like Esperanto. Yes it is an official language but nobody really uses it because it is an artifact.
 
Personally, I'm somewhat aghast that they've went against the whole essence of SI units by refining kilo-, mega- and giga- and other prefixes to mean something other than what it always has meant in everywhere: ten raised to power of a factor of three. It never has meant two raised to power of a factor of ten and never will. kibi-, mebi-, gibi- is IMNSHO, correct prefix if you want to talk in powers of two, not tens.

Biologists, Chemists, Engineers, and various other fields all agree on that kilo-<whatever units of measurement> means exactly same thing in terms of magnitude even if the quantity being measured are not same thing. Computer field is the only field that has acted like a willful jackass and tacked a wholly new definition that was incorrect, is not correct and will not be correct. It's certainly natural to think in powers of two and that's perfectly fine. Just don't take a perfectly good word and pervert its meaning, especially when we consider that the SI system was established for the purpose of consistency.

Therefore, kilobytes ought to mean 1,000 bytes, or 8,000 bits. If they want to use powers of two, then use kibibytes to mean 1,024 bytes or 8,192 bits.

They have no excuse other than slovenly laziness, I am sorry to say.
 
Personally, I'm somewhat aghast that they've went against the whole essence of SI units.

Agreed, but the SI boffins kind of set a precedent for unit theft when they named the tonne which was reasonably close in both magnitude and pronunciation to an imperial ton. Then expect to use "T" or "t" as the abbreviation. Should have been a Megagram.

The kibi etc units were only introduced in the late 1990s. The (improper)use of the SI multipliers had already been in place in the computer industry for decades.

You will notice that Microsoft UI never uses the full term except in the unambiguous "bytes". Elsewhere they are always KB, MB of GB. With the weight of Microsoft and its user community behind it, this usage will not be pushed aside easily.

In practical terms the two percent difference matters very little. I my computer experience most refer to either structure as "Kay" "Meg" and "Gig" knowing where to apply which multiplier. These terms have no meaning in SI so break no rules.:p
 
Agreed, but the SI boffins kind of set a precedent for unit theft when they named the tonne which was reasonably close in both magnitude and pronunciation to an imperial ton. Then expect to use "T" or "t" as the abbreviation. Should have been a Megagram.

Interesting. I've heard of 'short tons', and apparently incorrectly assumed 'tonne' was a localization of the word 'ton'. Well, goes to show how quickly we fail at the stated goal. :p :D

The kibi etc units were only introduced in the late 1990s. The (improper)use of the SI multipliers had already been in place in the computer industry for decades.

I'm given to understand that it was around almost as long as the computer industry, but just didn't become popular as the SI multipliers.

You will notice that Microsoft UI never uses the full term except in the unambiguous "bytes". Elsewhere they are always KB, MB of GB. With the weight of Microsoft and its user community behind it, this usage will not be pushed aside easily.

Well, in US, there has been (frivolous IMHO) lawsuits against hard drive manufacturers for false advertising or some of that sort because hard drive manufacturers (correctly) advertised the capacity in terms of SI multipliers and people were aghast to find that they lost a sizable chunk. The hard drive manufacturers lost those suits and must now report using gibibytes while using gigabytes.

In practical terms the two percent difference matters very little.

We're now moving into gigabytes where the difference becomes more significant. For example, my 320 gigabytes hard drive is reported as 297.77 gibibytes in Mac OS X. Mac OS X labels it as GB which is too easy to presume that it meant gigabytes. I am told that in next version that's about to release, Mac OS X has changed how they report the size and if I were to upgrade, my hard drive would be again 320 gigabytes. In all of this, the actual capacity of my hard drive hasn't changed. Only how we count it.

In my computer experience most refer to either structure as "Kay" "Meg" and "Gig" knowing where to apply which multiplier. These terms have no meaning in SI so break no rules.:p

Fair enough. :)
 

Users who are viewing this thread

Back
Top Bottom