using RtProprogress during a copy command

How would I get the size of the source and destination directories during a
copy command So I can update my RtProgress widget? I know there is a shell
command "du’. but can’t find a equivalent c/c++ function… anyone help?

Hello Ran

Look up the functions “stat”, “lstat”, and “fstat”. They provide the functionality
that you are looking for.

Thanks
Rodney

ran zhang <rzhang@vamcointernational.com> wrote:

How would I get the size of the source and destination directories during a
copy command So I can update my RtProgress widget? I know there is a shell
command "du’. but can’t find a equivalent c/c++ function… anyone help?

I used stat, then use .st_size to get the size, but it only reports the
standard folder’s size which is always 4096, not the actual content’s size
of the folder.
any suggestion?

Gui Group <gui@qnx.com> wrote in message news:9ov6b4$86o$1@nntp.qnx.com

Hello Ran

Look up the functions “stat”, “lstat”, and “fstat”. They provide the
functionality
that you are looking for.

Thanks
Rodney

ran zhang <> rzhang@vamcointernational.com> > wrote:
How would I get the size of the source and destination directories
during a
copy command So I can update my RtProgress widget? I know there is a
shell
command "du’. but can’t find a equivalent c/c++ function… anyone help?

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

I used stat, then use .st_size to get the size, but it only reports the
standard folder’s size which is always 4096, not the actual content’s size
of the folder.
any suggestion?

You have to stat each and every file in that directory. As far as I know
that
is what du does.

Or you could have a look at fstatvfs()