1.5 KiB
1.5 KiB
big-file-gen
Small Python CLI tools for creating and reading large files. Useful for storage testing, transfer checks, and dumb-fun disk abuse.
What it does
- create large binary files filled with zeros
- optionally create sparse files instead
- read files back and measure throughput
- optionally compute SHA256 while reading
- no third-party dependencies
Usage
Create a file
python make_big_file.py <output> <size> [--chunk-size SIZE] [--sparse] [--force] [--quiet]
Examples:
python make_big_file.py test.bin 15GB
python make_big_file.py dump.dat 1.5TiB --chunk-size 128MB
python make_big_file.py tiny.bin 500MB --quiet
python make_big_file.py sparse.img 20GB --sparse
python make_big_file.py test.bin 15GB --force
Read a file
python read_big_file.py <input> [--chunk-size SIZE] [--hash] [--quiet]
Examples:
python read_big_file.py test.bin
python read_big_file.py dump.dat --chunk-size 128MB --hash
python read_big_file.py tiny.bin --quiet
Size formats
Binary units are supported:
BKB,MB,GB,TB,PBKiB,MiB,GiB,TiB,PiB
Plain numbers are treated as bytes.
Exit codes
0success1failure130interrupted
Requirements
- Python 3.8+
- enough disk space for real writes
Notes
--sparseis handy when you want a huge file without actually burning the disk.--forceoverwrites an existing output file (without it, existing files are protected).--hashis SHA256, because anything weaker would be cosplay.