Re: show drive space used?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek,

Can't give you the proof you would like, but if my memory serves me, various
times I've installed new HD's, I've actually seen the "disclaimer" with or
on the drive that says they're using 1,000,000 bytes to mean 1 megabyte.
Don't have a bare drive handy to look at, though.

Dan Moyer

----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: show drive space used?


>
>
> [snip]
> >
> > Hello again Dan,
> >
> > As you probably already know, there are two standards for
> > defining a megabyte.
> >
> > 1.  1 megabyte=1,000,000 bytes
> > 2.  1 megabyte=1,048,576 bytes (1024*1024)
>
> Define 'standard'. If you mean an offical publication from an acknowledged
> standards body, then megabyte is 2 raised to the power 20 (1024 * 1024 =
> 1048576) bytes. The layman's term is used by advertisers to mean
> approximately one million bytes.
>
>
> > Hard disk manufacturers use #1 while memory uses #2.
>
> I disagree and would need proof of this assestion before changing my mind.
> The disk manufacturers tend to place the unformatted size on their disk's
> documentation. Formatting a disk will always take up some of this.
>
> > This means if you want to store a block of memory say
> > 4096 bytes (4kb) long on disk, it's going to take more
> > then 4kb to store it on disk!  In fact, it takes 4.096kb
> > on disk.
>
> Respectfully I again have to disagree. When I write a disk file that
> contains 4096 bytes, the amount of disk space used depends on the sector
> size in use. Using a 4KB sector size means that I can exactly use one
> sector of disk space, except in the rare circumstance when creating a new
> file causes the directory to expand over into a new sector too.
>
> Plus 4.096KB is 4194.304 bytes, and I'm not sure if disks can store
> partial bytes. A KB is still 1024 bytes is it not?
>
>
> > Since i wanted to show bytes used using the
> > memory standard, i used the conversion factor 1/1024
> > instead of 1/1000.
>
> Which is the better (consistant) approach, IMHO.
>
> > It makes sense to use the disk standard, but it also makes
> > sense to use the memory standard because this tells you how much space
> > you have for storing memory.  Using the
> > memory standard tells you that after you create a file
> > such as a bitmap that uses 32k bytes you will be using
> > 32k bytes of disk space when it's saved to a file.
> > Using the disk standard, after you create a file using
> > 32k bytes in mem you will be using up 32.768k bytes on disk,
> > which brings in a conversion factor.  It all depends
> > on how you want to look at it.
>
> Rubbish. Sector size has more influence on disk space usage.
>
> > What i SHOULD have done was define a constant that allowed
> > the user to select which they wanted to use in their program,
> > memory or disk standard.
> >
> >
> > If you want to see the bytes count match up with the
> > file/properties listing, it really should be quite easy...
> >
> > In function:
> >     GetDriveInfo()
> > change:
> >     kbdiv=1/1024
> > to:
> >     kbdiv=1/1000
> >
> > This means the returned info will match what the MS properites
> > dialog turns up.
>
> MS reports disk memory in MB (1024 * 1024) units.
>
> > As a final note, you may have to run scandisk to see a perfect match
> > (to the nearest 1000 bytes).
>
> Rubbish. All the operating system tools display this info using 1024=KB
> and 1048756=MB units.
>
>
> However I'm willing to be corrected. Just show me the proof.
>
> --
>
> cheers,
> Derek Parnell
>
>
>
> TOPICA - Start your own email discussion group. FREE!
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu