How to write du (disk usage) command

can anyone supply me with some source code about how to write ‘du’?
i need to ge the size of each file in a directory, and sum them up, and
if there are sub-directory, i ned to do it recursively… it seems
difficult,
can someone help??

My goal is to get the size of a directory, so I can update my RtProgress
during a ‘copy’ command…

“ran zhang” <rzhang@vamcointernational.com> wrote in message
news:9pa38l$1fc$3@inn.qnx.com

can anyone supply me with some source code about how to write ‘du’?
i need to ge the size of each file in a directory, and sum them up, and
if there are sub-directory, i ned to do it recursively… it seems
difficult,
can someone help??

My goal is to get the size of a directory, so I can update my RtProgress
during a ‘copy’ command…

Please cross-post in proper conference :wink: