You are wanting to get the size of all the files in the folder? Well that’s different than getting the file size of the directory.
Unix file systems directory size grows as more directory entries are added, but when the files are removed, the directory size does not go down, so it didn’t make much sense that you wanted the file size of the directory.
If you want the sum of the size of each file in the directory, then that’s different. You will have to loop over each file in the directory (which LFS can give you the list of files) and then get the stat information for each file and add it up.
Keep in mind too, that size may be in bytes, where as the OS may report it in 512byte blocks,
[import]uid: 199310 topic_id: 35385 reply_id: 143528[/import]