ProgressBar for Recursiv function

  • Thread starter Thread starter Marc van den Bogaard
  • Start date Start date
M

Marc van den Bogaard

hello together!

I have a function in my programm set runs recursiv through a directory
and lists all files in the directory, subdirectory, just everything.
my issue is now, how do i manage the progressbar
that it shows me the current status from 0 - 100%.
i tried to count all files and do it in this way but it isnt
fast enough, because in the end i run allready through the directory
and i dont want to do it two times.

does anyone have an idea?

thank you in advance.
marc van den bogaard
 
Marc van den Bogaard said:
I have a function in my programm set runs recursiv
through a directory and lists all files in the directory,
subdirectory, just everything.
my issue is now, how do i manage the progressbar
that it shows me the current status from 0 - 100%.
i tried to count all files and do it in this way but it isnt
fast enough, because in the end i run allready through
the directory and i dont want to do it two times.

Obviously, you can't calculate a percentage unless you know the total.
You could just count the directories first, and then show two progress
bars: one for the directories, and another for the files in the
directory currently being scanned.

If you really don't want to count anything first, I suppose you could
show an animated symbol (like the "flying documents" when copying
files) to indicate that something is happening.

P.
 
Back
Top