[cs631apue] why used blocks are always even in ls?

hao wu hwu9 at stevens.edu
Mon Oct 7 15:51:41 EDT 2013


Thanks ,will try it.


On Mon, Oct 7, 2013 at 3:26 PM, Tejas Nadkarni <tnadkarn at stevens.edu> wrote:

> You can test the system ls by setting the env for it. i.e. 'env
> BLOCKSIZE=512 ls -l'
>
> It will then use blocksize of 512 which is the default for our programs. I
> used this to make sure my output matches the system ls for the same
> blocksize.
>
>
> On Mon, Oct 7, 2013 at 3:21 PM, hao wu <hwu9 at stevens.edu> wrote:
>
>> I found out the reason, it because that my system physical block size
>> actually  is 4096.
>>
>> 12987/4096 = 3.17  ==> 4
>>
>> and BLOCKSIZE not have to set as the same value as the physical block size
>>
>>
>>
>>
>>
>> On Mon, Oct 7, 2013 at 3:09 PM, hao wu <hwu9 at stevens.edu> wrote:
>>
>>> suppose I have a file abc, its  size is 12987,
>>>
>>> the environment BLOCKSIZE now is 2048.
>>>
>>> 12987/2048  = 6.34
>>>
>>> I think the blocks used should be 7.
>>>
>>> but in ls ,it shows 8
>>>
>>> I found that the blocks used are always even in ls, any ideas?
>>>
>>> Thanks,
>>> Hao
>>>
>>>
>>>
>>
>> _______________________________________________
>> cs631apue mailing list
>> cs631apue at lists.stevens.edu
>> https://lists.stevens.edu/mailman/listinfo/cs631apue
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs631apue/attachments/20131007/8a3f933e/attachment-0001.html>


More information about the cs631apue mailing list