genfile - generate files of random data
genfile [-D] [-R] [-S seed] [-c] [-d dirname] [-f] [-g] [-s
minsize[-maxsize]] [-v] filename...
genfile generates and checks files of random data. The
files consist of records of 2113 random integers. The
record also includes the name of the file and the record
number. In addition, a file header is written before the
data records. The header contains the file name, the status
of the file (stat(2)), the random number seed and the data
length. This format allows the file data to be checked
later knowing only the file name.
The file is written using a buffer size of 41 records.
Using 41 and 2113 (which are prime numbers), avoids perform-
ing I/O in integer multiples of sector and block sizes.
File names may be generated by using the regular expression
"range" construction [x-y]. When such a filename argument
is used, each range construction, from right to left, is
For example, the file name file[A-C][0-9] generates the file
names fileA0 through fileC9.
Note, you need to "shell escape" the range constructions.
If one of the files to be generated already exists, that
file name is skipped.
-D Set "directio" on the file.
-R Allow rewriting of an existing file.
Set the random number seed.
-c Read and check files.
Use dirname as a prefix to the file names.
-f Do not report errors.
User Commands genfile(1)
-g Generate files. This is the default action.
Generate file with data of length size. The actual
length of the file will be size plus the length of the
file header (168 bytes on SPARC, 156 on x86) and the
length of the file name plus one and rounded up to the
next multiple of four. For example if size is speci-
fied as 10 and the file name is /var/file2, the actual
length of the file would be 190 bytes on a SPARC plat-
form and 178 bytes on an x86 platform.
Generate files with a random data length between min-
size and maxsize. The actual file length includes the
header and file name lengths as above.
-v Verbose output.