Tools@BasicAware

DummyFile

Purpose

DummyFile is a CLI tool that lets you create a specified number of plain (ANSI) text files of a specific size. The files are generated from random printable characters (plain text). Per default, the file's contents is generated as one 'big blob'. However, you can specify to add line feeds (actually LF + CR) to simulate 'proper text files'.


Download

Command line application DummyFile


Installation

None. Download the ZIP file, extract the included executable and run it.

Please note: this is a console application. You should run it from a command prompt.


Use case(s)


Syntax

DummyFile /n=<No. of files> /s=<file size> [/f=<folder to create files in>] [/lf] [/ll=<No. of characters per line>] [/fe=<file extension>]

Parameters:

Examples

DummyFile /n=10 /s=12MB

Create 10 files (in the current folder) with a size of 12MB each, do not add line feed(s).

DummyFile /n=10 /s=12MB /f=c:\temp

Create 10 files in the folder c:\temp with a size of 12MB each, do not add line feed(s).

DummyFile /n=10 /s=12MB /f=c:\temp /lf

Create 10 files in the folder c:\temp with a size of 12MB each, add line feed(s). Line length defaults to 80 characters.

DummyFile /n=10 /s=12MB /f=c:\temp /lf /ll=72

Create 10 files in the folder c:\temp with a size of 12MB each, add line feed(s). Line length should be 72 characters.

DummyFile /n=10 /s=12MB /f=c:\temp /lf /ll=72 /fe=txt

Create 10 files with the file extension 'txt' in the folder c:\temp with a size of 12MB each, add line feed(s). Line length should be 72 characters.


Source code

The PowerBASIC source code is available at Github


Known issues / limitations

  • DummyFile does not check for available disk space. Creating too many/big files may result in a full drive and, depending on how your OS handles full disks, may render your machine nonoperational.
  • The maximum file size depends upon available RAM and the application's capabilities to handle it :smile:. If you really need files larger than DummyFile is capable to create, a workaround is to use Windows' COPY command to concatenate two or more file(s):

    COPY SmallSourceFile1 + SmallSourceFile2 [+SmallSourceFile3] [+SmallSourceFileN] LargeDestinationFile


Version

  • 3.1.0 - October 2021
    • Reworked the file content / file creation in order to work around memory limitations when creating large files.
  • 3.0.0 - October 2017
    • The way command line parameters are handled has been change to accommodate the de facto standard of '/param=value' syntax.
    • A new parameter was add: /fe=file extension
  • 2.0.4 - September 2017
    • Bugfix. The creation of very large files failed without any user notification, when running out of RAM. This fix a) allows for a bit larger files to be created and b) if creation fails due to memory limitation, an appropriate error message is displayed.
  • 2.0.3 - May 2017
    • Compiler glitch workaround.
  • 2.0 - August 2012
    • Initial public release.
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Germany License .
All contents copyright © 2012-2024 by BasicAware, Knuth Konrad