On the kilobyte, the kibibyte and OS X

Discussion in 'macOS' started by kdum8, Apr 22, 2011.

  1. kdum8 macrumors 6502a

    kdum8

    Joined:
    Sep 8, 2006
    Location:
    Tokyo, Japan
    #1
    Am I correct in thinking that under OS X a kilobyte is 10^3 bytes? (The name kibibyte now referring to 2^10 bytes).

    See attached image showing the info tab for a text file I have.

    How can the file be 4 KB on disk and yet only 1,042 bytes of information? That seems like quite a discrepancy. Why does the text consume only 1,042 bytes of ascii information and yet take 4KB to store this to disk? What am I missing?

    The file is just a plain text file written in TextEdit.
     

    Attached Files:

  2. Satori macrumors 6502a

    Satori

    Joined:
    Jun 22, 2006
    Location:
    London
    #2
    I think the default block size on your HDD will be 4 KB.
     
  3. cube macrumors G5

    Joined:
    May 10, 2004
    #3
    The default allocation block size in Mac OS X is 4KiB. Don't make it smaller.
     
  4. kdum8 thread starter macrumors 6502a

    kdum8

    Joined:
    Sep 8, 2006
    Location:
    Tokyo, Japan
    #4
    Ahh I see. So the minimum size that any file in OS X can be is 4 KiB (4*2^10 bytes) regardless of how little data it contains?
     
  5. Satori macrumors 6502a

    Satori

    Joined:
    Jun 22, 2006
    Location:
    London
    #5
    That's right.
     
  6. kdum8 thread starter macrumors 6502a

    kdum8

    Joined:
    Sep 8, 2006
    Location:
    Tokyo, Japan
    #6
    Thanks. That cleared up that mystery. ;)
     
  7. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #7
    Nah, the file is whatever size it is, ie. smaller, but it uses up a full 4KB "spot" on the disk.
     
  8. old-wiz macrumors G3

    Joined:
    Mar 26, 2008
    Location:
    West Suburban Boston Ma
    #8
    Different file systems use different minimum size file allocations.
    I remember on some older systems the minimum was 8kb.
     

Share This Page