1. Bytes Question
- Posted by don cole <doncole at pacbell.net> Jul 05, 2006
- 653 views
Hello All, x=dir(myfile) x[D_SIZE] would be the file size in bytes. So would file size in Kbytes would be x[D_SIZE]/1000 or x[D_SIZE]/1024 ? What about Mbtyes? Don Cole
2. Re: Bytes Question
- Posted by Larry Miller <larrymiller at sasktel.net> Jul 05, 2006
- 580 views
don cole wrote: > > Hello All, > > x=dir(myfile) > x[D_SIZE] would be the file size in bytes. > So would file size in Kbytes would be x[D_SIZE]/1000 > or x[D_SIZE]/1024 ? What about Mbtyes? > > Don Cole A Kbyte is defined as 1024 bytes while a MByte is 1024 * 1024 =1048576 bytes. x[D_SIZE]/1024 would be correct. Larry Miller
3. Re: Bytes Question
- Posted by Antonio Alessi <a.admin at myway.it> Jul 05, 2006
- 573 views
don cole wrote: > > Hello All, > > x=dir(myfile) > x[D_SIZE] would be the file size in bytes. > So would file size in Kbytes would be x[D_SIZE]/1000 > or x[D_SIZE]/1024 ? What about Mbtyes? > > Don Cole Beware, x[1][D_SIZE] would be the file size of myfile in bytes. However one MB is 1024k in a binary system; if we have 256k, 512k etc. 1000 should have nothing to do with the true size. antonio
4. Re: Bytes Question
- Posted by Juergen Luethje <j.lue at gmx.de> Jul 05, 2006
- 560 views
don cole wrote: > x=dir(myfile) > x[D_SIZE] would be the file size in bytes. > So would file size in Kbytes would be x[D_SIZE]/1000 > or x[D_SIZE]/1024 ? What about Mbtyes? Good question. x[1][D_SIZE]/1000 = file size in kilobit (kbit) x[1][D_SIZE]/1024 = file size in kibibit (Kibit) see <http://physics.nist.gov/cuu/Units/binary.html> Regards, Juergen -- Please excuse my flawed English. My native language is Euphoria.
5. Re: Bytes Question
- Posted by Juergen Luethje <j.lue at gmx.de> Jul 05, 2006
- 561 views
Correction of my first post in this thread (of course it must be "byte" here, not "bit"): don cole wrote: > x=dir(myfile) > x[D_SIZE] would be the file size in bytes. > So would file size in Kbytes would be x[D_SIZE]/1000 > or x[D_SIZE]/1024 ? What about Mbtyes? Good question. x[1][D_SIZE]/1000 = file size in kilobyte (kbyte) x[1][D_SIZE]/1024 = file size in kibibyte (Kibyte) see <http://physics.nist.gov/cuu/Units/binary.html> Regards, Juergen -- Please excuse my flawed English. My native language is Euphoria.
6. Re: Bytes Question
- Posted by "Greg Haberek" <ghaberek at gmail.com> Jul 05, 2006
- 586 views
> x=dir(myfile) > x[D_SIZE] would be the file size in bytes. > So would file size in Kbytes would be x[D_SIZE]/1000 > or x[D_SIZE]/1024 ? What about Mbtyes? KiloByte: 1024 Bytes MegaByte: 1024 KiloBytes (1,048,576 Bytes) GigaByte: 1024 MegaBytes (1,073,741,824 Bytes) TeraByte: 1024 GigaBytes (1,099,511,627,776 Bytes) For each step (KB, MB, GB, TB) divide by 1024. ~Greg
7. Re: Bytes Question
- Posted by Jordan Bell <jordanbell at comcast.net> Jul 07, 2006
- 581 views
>> x=dir(myfile) >> x[D_SIZE] would be the file size in bytes. >> So would file size in Kbytes would be x[D_SIZE]/1000 >> or x[D_SIZE]/1024 ? What about Mbtyes? >KiloByte: 1024 Bytes >MegaByte: 1024 KiloBytes (1,048,576 Bytes) >GigaByte: 1024 MegaBytes (1,073,741,824 Bytes) >TeraByte: 1024 GigaBytes (1,099,511,627,776 Bytes) >For each step (KB, MB, GB, TB) divide by 1024. >~Greg It may or may not be relevant depending on what you are upto/why you want to know, but some manufacturers, especially those of hard disk drive (HDD) abuse the system. You can frequently find HDD capacities in GB that are measured as 10^9 bytes instead of 2^30 Jordan
8. Re: Bytes Question
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 07, 2006
- 589 views
This link is informative. http://en.wikipedia.org/wiki/Megabyte Summary: Because of inconsistencies in the use of SI-derived prefixes such as kilo- and mega-, the exact number can be any one of the following: 1,048,576 bytes (1,0242, 220): This definition is used for nearly all discussions of computer memory (as computer addresses are naturally powers of two, making it efficient to manufacture memory in power-of-two capacities) and file storage. As of 2005, most software uses this definition to express storage capacity (e.g. file size). 1,000,000 bytes (1,0002, 106): This is the definition recommended by SI and IEC. It is used primarily in networking contexts and most storage media, particularly hard drives and DVDs. This definition of 'mega-' as a SI prefix is consistent with the other SI prefixes, and with many other uses of the prefix in computing, such as CPU clock speeds or measures of performance. 1,024,000 bytes (1,024×1,000): This definition occurs rarely. It was used in a small number of storage contexts, most notably the "1.44 MB" (actually 1,474,560 bytes), and the "3.5-inch" (actually 90 mm) high-density floppy diskette. Several attempts to resolve these inconsistencies have been proposed, most notably the standard created by the IEC to redefine 1,048,576 bytes as a "mebibyte". This standard has been adopted by several organizations, such as the NIST and IEEE. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell