recursively, and then calculates their size and that is the entire file directory.
Because the file size that is returned directly is in bytes, we generally have to convert to the size we usually get, and here is the function of the unit conversion:
The code is
The size of the computer stores information, the most basic unit is byte, a Chinese character consists of two bytes, letters and numbers are composed of a byte.
Units of capacity are from small to large: bytes (B), KB, MB, GB, TB. The relationship between them is.
1tb=1024gb
1gb=1024mb
1mb=1024kb
1kb=1024 bytes
U
The smallest base unit is byte. Not many people do not know, the following first in order to give all units
Byte, KB, MB, GB, TB, PB, EB, ZB, YB, DB, NB
I only know the top five, and most people know that, according to the rate of 1024 calculation
40 1tb=2 byte=1099511627776 Byte of the second order
1pb=2 's 50-time Square Byte=1125899906842624byte
60 1eb=2 byte=
What is the storage unit of a computer?
Computer storage units are generally expressed in bit, Byte, KB, MB, GB, TB, PB, EB, ZB, BB,
We often refer to the byte abbreviation as B and ask K for the KB abbreviation. What a few k, what a few B.
Two, what is their conversion
The size of the php statistics file, which is measured in GB, MB, KB, and B. Use the filesize () function command to calculate the file size. the value 1 must be an output of GB, MB, KB, and B. 2. the order of magnitude must be greater than 1 and less than 1024, and two deci
In the computer newspaper, the Dutch bank's 20 data centers have about 7PB of disk and more than 20PB of tape storage, and the annual growth of 50%~70% reserves,
So want to see how much PB, calculate 27pb about 400,000 80 of the hard disk size.
1Byte = 8 Bit (0,1)
1 KB = 1,024 Bytes (size of a shortcut)
1 MB = 1,024 KB = 1,048,576 Bytes (size of a floppy disk)
1 GB
, that is, the 70-power byte of 2, the pronunciation of "Z Byte"1yib (yottabyte) = 1024zib, that is, the power byte of 2, the pronunciation of "y Byte"
Legend has it that
1nib (nonabyte) = 1024yib, that is, the 90-power byte of 21dib (doggabyte) = 1024nib, that is, the 100 power byte of 21cib (corydonbyte) = 1024dib, t
I learned the fread reading command and used the filesize function. when I knew that this function was useful, I used it to compile the statistics file size function and used the filesize () function command to collect statistics on the file size, requirements: 1, with one output in GB, MB, KB, and B; 2. the order of magnitude must be greater than 1 and less than 1024, and two decimal places must be retaine
Android get folder, file size in B, KB, MB, GBpublic class Filesizeutil {public static final int sizetype_b = 1;//Gets the double value of file size unit B public static final int sizety pe_kb = 2;//Gets the file size in kilobytes of double value public static final int sizetype_mb = 3;//Gets the file size unit to MB Double value public static final int sizety PE_GB = 4;//Gets the file size unit is a double
Storage Capacity Unit: Bit, Byte, KB, MB, GB, TB, PB, EB, ZB, YB, zbyb
I recently read the Hadoop authoritative guide book, which has been designed by many organizations,
However, my previous books seem to only teach GB,
The current textbooks may be terabytes or petabytes of data, but I'm not sure. However, in the near future, there may be larger units that ca
Use the filesize () function command to calculate the file size. The value 1 must be an output of GB, MB, KB, and B. 2. the order of magnitude must be greater than 1 and less than 1024, and two decimal places must be retained;Start:Copy codeThe Code is as follows:$ Len = filesize ("1. rmvb ");$ I = 4;While ($ I ){If ($ out = $ len/pow (1024, $ I)> 1.0 | $ I = 1 )
This article mainly introduces the PHP implementation of byte-byte conversion to KB, MB, GB, TB method, combined with an instance of PHP for the byte count of the conversion operation of the specific implementation method, involving the use of PHP mathematical operations related functions, the need for friends can refer to the next
This article describes the PHP implementation of byte bytes converted to
Today in doing a network audit log when required to export the report, there is a mail attachment file size, the database is bytes byte number, the request to convert to KB display, use the following function, quite to the force, special to share.
function Sizeformat ($bytesize) {$i = 0;When the $bytesize is greater
In a file-processing system, it is easy to get the size out of some system's own method, the problem is that the size is often just a byte B.If you want to convert this byte number to a KB, MB, GB final rendering to the user, it involves the arithmetic operation of dividing
Exposure to computers all day, inevitably with a variety of measurement units to deal with, especially data, but you know bit, Byte, KB, GB, TB and so on all means how much data? Have you heard of EB, ZB, YB?
Bit (bit) is the initials of binary digit, the unit that measures information, and the smallest unit that represents the amount of content, only 0 or 12 bi
This is a PHP program to get the size of the file and the file according to the size of the file display GB,MB,KB code code is very smart code, the code is as follows:
function Sizecount ($filesize) {
if ($filesize >= 1073741824) {
$filesize = Round ($filesize/1073741824
Having stayed at school, I went over PhP and looked at the previously written functions. I suddenly wanted to write the known file size and sort the data.
For example: 1.3G, 153 MB, 458kb, 998 m, 0.99g (the difference between MB and MB is not considered here, and generally does not involve the operation of MB, so MB, MB, and MB are regarded as mb. In fact, MB = 8 * MB)
The function is as follows:
PHP
For example, when we refer to "data transfer speed" and "hard disk storage space", kilobytes represent 1000 (103), and when it comes to memory or CPU cache capacity, kilobytes represent 1024 (210) because they are stored here by byte-code address.
In practical applications, we often need to convert bytecode to KB, MB, GB, and so on, where we use JavaScript to convert bytecode:
The code
In the computer newspaper, I saw that ABN Amro's 20 data centers have about 7PB of disk and more than 20PB of tape storage, and the annual 50%~70% growth of storage,
So I want to see how big the PB is, and calculate the 27PB size of the hard disk about 400,000 80.
1Byte = 8 Bit (0,1)
1 KB = 1,024 Bytes (size of a shortcut)
1 MB = 1,024 KB = 1,048,576 Bytes (size
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.