how do i read a block

Manish Katiyar mkatiyar at gmail.com
Tue May 14 16:26:15 EDT 2013


On Mon, May 13, 2013 at 1:05 AM, shampavman <shampavman.cg at gmail.com> wrote:

> Hi all,
>
> Supposing i create a file of size 10K, it will occupy 2 blocks (4K each).
>

I must be missing something obvious. Why does a file of 10K only needs 2
blocks of 4K ? You haven't mentioned that it has any holes in it.




> Now if i want to read only 1 block from it how can i do it?
>
> read(fd, buf, 4096) ;
> would this mean i would read the first block and all its contents?
>
> Thanks
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
Thanks -
Manish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130514/19439946/attachment.html 


More information about the Kernelnewbies mailing list