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 as follows
Copy Code
function Sizeformat ($size){$sizeStr = ';if ($size {return $size. "bytes";}else if ($size {$size =round ($size/1024,1);return $size. " KB ";}
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
Usually people use the simple name, the back o
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 relationship? 1, the smallest unit in whic
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 gr
1 TB = 1024 GB 1 GB = 1024 MB 1 MB = 1024kb 1kb = 1024 byte note: byte means B, that is, byte KB is a kilobytes of MB, that is, GB is a Gigabit, that is, a gigabit. Generally, they can
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
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 Bit1 KB = 1,024 Bytes1 MB = 1,024 KB = 1,048,576 Bytes1 GB = 1,024
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
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
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
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 n
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
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 than 1024 bytes, start the loop, when the loop jumps to the 4th time;while (ABS ($bytesize) >=1024) {$bytesize = $bytesize/1024;$i + +
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 * 100)/100. ' GB ';
} elseif ($filesize >=
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 and taking the remainder.Here's how:public static String getprintsize (long size) {///If t
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 co
Bit-----bit, bit, both of which can be said. It is the smallest unit of storage data in the computer.For example: 1111 1111 or 0000 0000 Each 1 or each 0 is a bit.byte--byte (denoted by B), which is the basic unit of computer storage capacity1 byte = 8 bit = "A" or "B"//is a letter of 26 letters anyway.2 byte = 1 Kanji =2 * 8=16 bit (this sentence can also be written in 2b=1 kanji =16 bit)Kb1 KB = 1024x768 byte (or write 1
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.