randomFile

Reads bytes from a randomly chosen file into a variable.

Reads bytes from a randomly chosen file into a variable.
Two formats are supported:
Example 1 - without weights:

toVar: myVar
files:
- /path/to/file1.txt
- file2_relative_to_benchmark.txt

Example 2 - with weights (the second file will be returned twice as often):

toVar: myVar
files:
  /path/to/file1.txt: 1
  file2_relative_to_benchmark.txt: 2
PropertyTypeDescription
filenameVarStringOptional variable to store the filename of the random file.
filesBuilderPotentially weighted list of files to choose from.
toVarStringVariable where the chosen byte array should be stored.

files

PropertyTypeDescription
<any><list of strings>Item as the key and weight (arbitrary floating-point number, defaults to 1.0) as the value.
<list of strings><list of strings>Item as the key and weight (arbitrary floating-point number, defaults to 1.0) as the value.

Last modified September 2, 2024: docs: fix quickstart links (245525b)