FileProgressBar: A progress bar that sets the size of a file accordingly

FileProgressBarR Documentation

A progress bar that sets the size of a file accordingly

Description

Package: R.utils
Class FileProgressBar

Object
~~|
~~+--ProgressBar
~~~~~~~|
~~~~~~~+--FileProgressBar

Directly known subclasses:

public static class FileProgressBar
extends ProgressBar

Usage

FileProgressBar(pathname=NULL, ...)

Arguments

pathname

The pathname of the output file.

...

Other arguments accepted by the ProgressBar constructor.

Details

A progress bar that sets the size of a file accordingly. This class useful to check the progress of a batch job by just querying the size of a file, for instance, via ftp.

Fields and Methods

Methods:

cleanup -
update -

Methods inherited from ProgressBar:
as.character, getBarString, increase, isDone, reset, setMaxValue, setProgress, setStepLength, setTicks, setValue, update

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson

Examples

  ## Not run: 
  
# Creates a progress bar (of length 100) that displays it self as a file.

pb <- FileProgressBar(file.path(tempdir(), "progress.simulation"), max = 10L)
reset(pb)
while (!isDone(pb)) {
  x <- rnorm(3e4)
  increase(pb)
  # Emulate a slow process
  if (interactive()) Sys.sleep(0.1)
  cat(sprintf("File size: %d bytes\n", file.info(pb$pathname)$size))
  Sys.sleep(0.01)
}

  
## End(Not run)
 

R.utils documentation built on Nov. 18, 2023, 1:09 a.m.