[cs631apue] total num of blocks

ccui1 ccui1 at stevens.edu
Sat Oct 20 13:30:54 EDT 2012


Hello prof.

My Linux system will display the number of blocks using 1024 as the 
default block size if there is on BLOCKSIZE environment value is set.
If I set the BLOCKSIZE environment value, it will display the result 
based on that number.

In our project, the only difference is we use 512 as the default block 
size. Am I correct?

In addition, if I change the BLOCKSIZE environment value, the total 
number of blocks used by the directory will also change based on that 
value.
But, our project requires that

"In addition, for each directory whose contents are displayed, the 
total number of 512-byte blocks used by the
les in the directory is displayed on a line by itself immediately 
before the information for the les in the
directory.
"

Does that means no matter what environment value I gives, the output 
just calculate the number of blocks by using the 512 block size?
However, in such way, it will obey the Linux manual page.

Which calculation method should we use?
I prefer the first method which is based on the environment values.(If 
it is not given, then use the default value which is 512)

Thanks
-- 
Chao Cui
phone: 518-505-0519
Master of Computer Science Candidate
Stevens Institute of Technology


More information about the cs631apue mailing list