#generator #file #random #utilities #rust

app rfgen

Program to create large file consisting of random data

2 unstable releases

0.2.0 Aug 20, 2023
0.1.0 Aug 19, 2023

#433 in #random

MIT license

8KB
93 lines

Random File Generator

Program to create large file consisting of random data

Why

This implementation is very fast and has no memory leaks, so you can create files blazingly fast

Installation

  1. Install Rust
  2. Run cargo install rfgen
  3. Run rfgen <Arguments>

Usage

Program to create large file consisting of random data

Usage: rfgen [OPTIONS] <SIZE>

Arguments:
  <SIZE>  The size of each file. Suffixes: KB, KiB, MB, MiB, GB, GiB, TB, TiB

Options:
  -a, --amount <AMOUNT>  The amount of files of the specified size [default: 1]
  -o, --offset <OFFSET>  Offset of the filename index [default: 0]
  -p, --prefix <PREFIX>  File prefix [default: ]
  -s, --suffix <SUFFIX>  File suffix [default: ]
  -h, --help             Print help
  -V, --version          Print version

Result

The result will be files called 0000, 0001, 0002, etc.
Eg

~> rfgen 10GB -a 10
~> ls
╭───┬──────┬──────┬─────────┬──────────╮
│ # │ name │ type │  size   │ modified │
├───┼──────┼──────┼─────────┼──────────┤
│ 00000 │ file │ 10.0 GB │ now      │
│ 10001 │ file │ 10.0 GB │ now      │
│ 20002 │ file │ 10.0 GB │ now      │
│ 30003 │ file │ 10.0 GB │ now      │
│ 40004 │ file │ 10.0 GB │ now      │
│ 50005 │ file │ 10.0 GB │ now      │
│ 60006 │ file │ 10.0 GB │ now      │
│ 70007 │ file │ 10.0 GB │ now      │
│ 80008 │ file │ 10.0 GB │ now      │
│ 90009 │ file │ 10.0 GB │ now      │
╰───┴──────┴──────┴─────────┴──────────╯

Dependencies

~4–6MB
~107K SLoC