with-file-reader-progress ( path encoding quot -- )
Progress bar models

Prev:set-progress-bar ( ratio/float -- )


Vocabulary
progress-bars.models

Inputs
patha pathname string
encodingan encoding
quota quotation


Outputs
None

Word description
Opens a file for reading, displays a progress bar, and calls the quotation for processing the file. The progress bar will automatically update every 100 milliseconds, but only if the quotation yields (by calling yield) so that the UI has a chance to redraw.

Examples
Loop through the Factor image file, discarding each character as it's read and updating a progress bar:
USING: system progress-bars.models prettyprint io.encodings.binary threads ; image-path binary [ [ 4096 read yield ] loop ] with-file-reader-progress


Definition