[cs631apue] Midterm Question

tparisi tparisi at stevens.edu
Sun Sep 23 12:48:25 EDT 2012


I'm still unclear on how to get the total number of blocks for the
directory, if the blocksize is 512 of course.  It is my understanding
that the st_blocks in the stat structure is only for the directory
entry and not the entire file.  Am I correct on that thinking?  If I
am, then that means that each file's block count need to be added up
and that will give the total number of blocks used in the directory.
This would have to recurse all through the directories even if it
wasn't specified by the user correct?
Thanks,
Tom Parisi


More information about the cs631apue mailing list