Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This is a tricky question. I don't recall seeing any instance of a non-indexed search showing a progress bar. (Can anyone prove me wrong?)</p> <p>I'd suggest the following method (an extension of Benny Hallett's suggestion) that might provide more granuity.</p> <p>Let's assume that you're searching for a specific filename pattern across an entire filesystem (e.g. in unix, searching for all *.jpg files on /)</p> <p>Start by dividing your progress bar into N pieces (where N is the number of directories in the root path of your search).</p> <p>Each time you go deeper into the directory heirachy, the total process bar length that was allocated to the parent directory is divided up depending on the number of sub-directories it contains. When the search of a directory is complete, the portion that was allocated to it is added to the progress bar. For even more detail you can further divide the allocation by the number of files + directories in the current directory.</p> <p>This method should ensure that you only have to traverse the directory structure once and it should handle uneven directories better. (By uneven I mean a mixture of directories with high and low search costs)</p> <p>As an example, let's assume a directory structure like so:</p> <pre><code>/ clipart photos family holiday wallpapers anime landscapes </code></pre> <p>(each indent indicates a level deeper in the directory tree and let's assume that all directory traversal is done in alphabetical order)</p> <p>You start off by looking at '/' and seeing that there are three directories (<em>clipart</em>, <em>photos</em> and <em>wallpapers</em>) and thus you initially divide up the progress bar into thirds.</p> <p>You then search the <em>clipart</em> directory and when finished, updated your progress bar to one third. You then go inside <em>photos</em> and see that there are two sub-directories. This then means that when you finish searching <em>family</em> you add one sixth to the progress bar as there are two sub-directories (<em>family</em> and <em>holiday</em>) and progress against each one of these constitutes one half the one third allocated to <em>photos</em>.</p> <p>So in summary:</p> <p>completion of clipart adds one third</p> <p>completion of photos/family adds one sixth</p> <p>completion of photos/holiday adds one sixth</p> <p>completion of wallpapers/anime adds one sixth</p> <p>completion of wallpapers/landscapes adds one sixth</p> <p>For a total of 1.0 (or 100%) (ignoring floating point precision)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload