Implementing progress bar

Hi,
I want to implement progress bar in my application .

When I m giving "cp -R "on terminal, I m getting the output like :
cp:copying to
etc etc.

If I can get the percentage part then I can implement what I want.

So can anybody please tell me how to do this !

Thanking you

Jitendra

Take a look at “popen()”


Jitendra Sasmal wrote:

Hi,
I want to implement progress bar in my application .

When I m giving "cp -R "on terminal, I m getting the output like :
cp:copying to etc etc.

If I can get the percentage part then I can implement what I want.

So can anybody please tell me how to do this !

Thanking you

Jitendra
\

Hi Darrin,
Thank u for ur valuable suggestion.

One more thing I want to know.

See, I have written my own copy command to copy files and also able to
capture the percentage of bytes copied. But here the problem is that when
I am trying to set this value to progress bar by
" PtSetResource(ABW_PtProgr,Pt_ARG_GAUGE_VALUE,per,0);"
the progress bar is not getting updated at that time. Only it is showing
the final value after the copy completion.

So can u please tell me how to update the progress bar while copying ?

Thanking you !

With Regards
Jitendra

Darrin Fry wrote:

Take a look at “popen()”



Jitendra Sasmal wrote:
Hi,
I want to implement progress bar in my application .

When I m giving "cp -R "on terminal, I m getting the output like :
cp:copying to etc etc.

If I can get the percentage part then I can implement what I want.

So can anybody please tell me how to do this !

Thanking you

Jitendra
\

Jitendra Sasmal <sasmal_jk@rediffmail.com> wrote:

Hi Darrin,
Thank u for ur valuable suggestion.

One more thing I want to know.

See, I have written my own copy command to copy files and also able to
capture the percentage of bytes copied. But here the problem is that when
I am trying to set this value to progress bar by
" PtSetResource(ABW_PtProgr,Pt_ARG_GAUGE_VALUE,per,0);"
the progress bar is not getting updated at that time. Only it is showing
the final value after the copy completion.

So can u please tell me how to update the progress bar while copying ?

Thanking you !

With Regards
Jitendra

If you are in a tight loop, i.e.

int func(…)
{
while(copying)
PtSetResource …

return(Pt_CONTINUE);
}

the widget engine does not get a chance to run. You need to change
it to the following:

int func(…)
{
while(copying)
{ PtSetResource …
PtBkgdHandlerProcess();
}

return(Pt_CONTINUE);
}

Good luck and regards.

Darrin Fry wrote:

Take a look at “popen()”



Jitendra Sasmal wrote:
Hi,
I want to implement progress bar in my application .

When I m giving "cp -R "on terminal, I m getting the output like :
cp:copying to etc etc.

If I can get the percentage part then I can implement what I want.

So can anybody please tell me how to do this !

Thanking you

Jitendra
\

Hi,
Thank u very much !!! This is working .

Regards
Jitendra


Derek Leach wrote:

Jitendra Sasmal <> sasmal_jk@rediffmail.com> > wrote:
Hi Darrin,
Thank u for ur valuable suggestion.

One more thing I want to know.

See, I have written my own copy command to copy files and also able to
capture the percentage of bytes copied. But here the problem is that when
I am trying to set this value to progress bar by
" PtSetResource(ABW_PtProgr,Pt_ARG_GAUGE_VALUE,per,0);"
the progress bar is not getting updated at that time. Only it is showing
the final value after the copy completion.

So can u please tell me how to update the progress bar while copying ?

Thanking you !

With Regards
Jitendra

If you are in a tight loop, i.e.

int func(…)
{
while(copying)
PtSetResource …

return(Pt_CONTINUE);
}

the widget engine does not get a chance to run. You need to change
it to the following:

int func(…)
{
while(copying)
{ PtSetResource …
PtBkgdHandlerProcess();
}

return(Pt_CONTINUE);
}

Good luck and regards.

Darrin Fry wrote:

Take a look at “popen()”



Jitendra Sasmal wrote:
Hi,
I want to implement progress bar in my application .

When I m giving "cp -R "on terminal, I m getting the output like :
cp:copying to etc etc.

If I can get the percentage part then I can implement what I want.

So can anybody please tell me how to do this !

Thanking you

Jitendra
\