File size in Snow Leopard

前端 未结 4 1022
说谎
说谎 2021-02-11 08:30

I\'m trying to figure out how to convert a file\'s (or directory\'s) byte size into kilobytes, megabytes, gigabytes, etc... respectively according the file\'s or directory\'s si

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-11 08:46

    In HFS+ each file will occupy a multiple of 4,096 bytes (the "block size").

    If your directory contains one thousand 1-byte files, the total size occupied by the directory would be

    (1000 * 4,096) = 4,096,000 = 4.1 MB,
    

    although the number of bytes used by the directory is still

    1 * 1000 = 1,000 bytes.
    

提交回复
热议问题