| DUMMYDIR(1) | User Commands | DUMMYDIR(1) |
NAME
dummydir – generate and manipulate a directory tree of files for
testing purposes
SYNOPSIS
dummydir operation directory [options]
dummydir [–replay=replay-file] directory
DESCRIPTION
dummydir (DummyDir) generates and manipulates a directory
tree of files for testing purposes. It uses a deterministic, seedable
pseudo-random number generator, so a run can be reproduced exactly later
from its recorded seed.
Every dummy directory maintains a manifest file,
DummyDir.manifest, in its root, which tracks the files and
subdirectories that dummydir created and is responsible for.
Operations only ever add, modify, or remove items recorded in this manifest;
files and directories not created by dummydir are never touched, even
if they live inside the target directory.
Every run is also logged to a replay file, DummyDir.replay,
in the root of the target directory. This file records each operation and
the flags (including the random seed) it was invoked with, so the exact
sequence of operations can be reproduced later with –replay.
OPERATIONS
- add
- Add new files to the dummy directory.
- delete
- Delete existing files from the dummy directory.
- modify
- Modify the contents of existing files.
- rename
- Rename existing files.
- move
- Move existing files to a different directory.
- dadd
- Add new subdirectories.
- drename
- Rename existing subdirectories.
- dmove
- Move existing subdirectories to a different parent directory.
- ddelete
- Delete existing subdirectories, along with everything inside them.
- clean
- Remove every file and directory this tool has created.
- verify
- Check that every file on disk matches what the manifest recorded.
- rebuild
- Rebuild the manifest from what is actually present on disk.
OPTIONS
- –size=value
- Total number of bytes the operation should affect. Accepts K/M/G/T/P/E
suffixes (e.g. 500M, 2.5G), a percentage of the relevant total (e.g. 25%),
or a range to pick randomly from (e.g. 1k-10m). Shorthand: -s. - –count=value
- Total number of items (files or directories) the operation should affect.
Accepts the same percentage and range rules as –size. Shorthand:
-c. - –fileseed=value
- A numerical value that acts as a seed for file add and modify operations.
Files with identical seeds will have identical data. Ranges may be
used. - –filesize=value
- For add, the size of each new file. For modify, how much of
each file’s content to change. Same value rules as –size. - –filetype=type
- For add only: random, binary, sparse, or
text. Default: random. - –modifytype=type
- For modify only: append, truncate, overwrite,
chop, insert, or random. Default: random. - –maxdepth=N
- For dadd and dmove only: how many levels deep the directory
structure is allowed to go. Default: 2. - –threads=N
- Number of worker threads to use for file operations. 0 or 1 disables
threading. Default: the number of hardware threads available. - –seed=hex
- Seed for the pseudo-random number generator, as a hex string. If not
given, a random seed is generated and recorded so the run can be
reproduced later. - –verbose
- Print details about every individual error, conflict, or discrepancy
found, instead of just a summary count. Shorthand: -v. - –replay[=file]
- Execute the operations, in order, from the provided replay file.
- –help
- Show a help message and exit.
EXIT
STATUS
- 0
- Success.
- 1
- Invalid arguments, an unrecognized operation or flag, or a missing/invalid
directory path, exception thrown, or files did not pass validation.
FILES
- DummyDir.manifest
- Located in the root of the target directory. Tracks every file and
directory dummydir has created there, along with each file’s size
and MD5 hash. - DummyDir.replay
- Located in the root of the target directory. A log of every operation
performed against it, in the exact form needed to reproduce the run with
–replay.
EXAMPLES
- Add 500 megabytes of new files,
each between 10 and 20 megabytes: - dummydir add ./mydir –size=500M –filesize=10M-20M
- Delete 25% of the files
currently in the directory: - dummydir delete ./mydir –count=25%
- Move 5 random subdirectories,
keeping the tree to 3 levels deep or less: - dummydir dmove ./mydir –count=5 –maxdepth=3
- Check every file against the
manifest, listing any problems found: - dummydir verify ./mydir –verbose
- Rebuild the manifest
from what is actually present on disk: - dummydir rebuild ./mydir
- Replay a previously
recorded sequence of operations: - dummydir –replay ./mydir
NOTES
Every operation, once completed, reports how many bytes and how
many items were affected, along with the resulting MD5 hash of the manifest
file. Two runs performed with the same sequence of operations and the same
recorded seeds will always produce manifests with an identical hash, which
makes dummydir suitable for reproducible test fixtures and regression
baselines.
Numeric flags can be presented as a single number (eg 101), range
of numbers (eg 101-150), percentage (50%), or range of percentages
(25%-50%). A letter can be placed after the number to indicate a base 2
multiplier (eg 10k = 10240).
AUTHOR
Written by Chris Bartle.
LICENSE
BSD 3-Clause License. See the LICENSE file distributed with
the source code for the full text.
| 2026-08-03 | DummyDir 1.0.1.0 |