All pastes #802665 Raw Edit

Something

public text v1 · immutable
#802665 ·published 2007-11-30 15:03 UTC
rendered paste body


yanilsama:~# stat  /etc/passwd
  File: `/etc/passwd'
  Size: 1300            Blocks: 4          IO Block: 4096   regular file

how can i 1300 bytes long file use 4 blocks of 4096 bytes?


yanilsama:~# du  /etc/passwd
2       /etc/passwd

is this number 2, the number of 1024 byte sized device block count?

if i want to write a C program like du , and if i use the stat struct it will give me 4 like the stat command, what should i do to get result like du?