Jesus 'n Jim
A mainly PC (some Mac) site w/Software, Computer Repair Info, How-To's on Using Computers
Technical Support 1-360-521-2060 (my business line cell)

createfile (C)

 

createfile is useful for filesystem limits testing, or just for creating an extremely large binary file with a specific size or specific basic repeating pattern in it.
you can download the source code and executeable as a single createfile.zip file.
it is now available as a DOS version as well as a windows version. It is under the GPL3 license and the Mersenne Twister License. lsm file.

Download Now
createfile-3.17-setup.exe (version 3.20, 7/17/2011)


Download Now
createfile.zip (version 3.20, 7/17/2011)


07/17/2011  11:09 PM         5,668,225 createfile-3.20-setup.exe
07/17/2011  11:16 PM        11,081,350 createfile.zip

%%%% HASHDEEP-1.0
%%%% size,md5,sha1,sha256,filename
## Invoked from: C:\prj\createfile
## C : \ >  hashdeep -c md5,sha1,sha256 createfile-3.20-setup.exe createfile.zip
##
5668225,ff70b3158ac5f78fbee6fd63677414fb,f126044f22e89b6eefd570b597f56b39c5b39170,868660a62c49ce41c1f36a951be7b4f800b410633948d53c32
31c50a786d108b,C:\prj\createfile\createfile-3.20-setup.exe
11081350,7d811507bfe517852b4f702caf799a57,04caa362b7d59620960d209b5d1dc79dce4820bb,ca54770822f934e9dc85ef5d10a027f0171614c3b1123f453
ba23d2a5fc7a2b5,C:\prj\createfile\createfile.zip

Warnings

Warning: if you fill up your disk, your OS may grind to a halt or act
unpredictably. check your disk space first and make sure you
get your numbers correct and leave yourself enough disk space
left!

Documentation

compiled with free Borland C++ 5.5 command-lineMinGW-64 compiler for windows (32+64-bit), and 32-bit DJGPP for DOS version

createfile - create file of specific size filled with specific pattern or random data
usage:
createfile [/?] [-[-]?] [/h[elp]] [-[-]h[elp]] [/v[er[sion]]] [-v[er[sion]]]
createfile [-[-]w[ord[s]]|/w[[ord]s] integer64sizeInBytes integer64data [integer64data...]] [-[-]repeat integer64numRepeats] [-[-]f[ile[path|na
me]] filepath]
createfile [-[-]w[ord[s]]|/w[[ord]s] integer64sizeInBytes integer64data [integer64data...]] [-[-]s[ize]|-filesize|/filesize|/s[ize] integer64filesize]
createfile [-[-]string|/string "some string data"] [-[-]repeat integer64numRepeats] integer64] [-[-]f[ile[path|name]] filepath]
createfile [-[-]string|/string "some string data"] [-[-]s[ize]|-filesize|/filesize|/s[ize] integer64filesize] [-[-]f[ile[path|name]] filepath]
createfile [-[-]r[andom]] [-[-]s[ize]|-filesize|/filesize|/s[ize] integer64filesize] [-[-]f[ile[path|name]] filepath]

Overview:
createfile fills file at filepath with integer64 data words, 63-bit-integer bytes in size. on the order of exabytes.
integer64 is case insensitive and can be: decimal (plain old numbers or starting with 0d), hex (starting with 0x), octal (starting w
ith a 0 0o or 0q), binary (starting with 0b), number can appended with SI units (_B _K _KB _M _MB _G _GB _T _TB _P _PB _E _EB) or co
mputer units (_Ki _KiB _Mi _MiB _Gi _GiB _Ti _TiB _Pi _PiB _Ei _EiB) as a multiplier, _K or _KB=1000 and _Ki or_KiB=1024 (computer K
).

-word's first parameter is an integer (number of bytes in each data word).  subsequent integers are data words, unsigned.  I chose u
nsigned because it is more generic and handles different numbers of data widths better. maximum size that can be handled is 8.  anyt
hing larger will be leading-padded with 0x00 bytes.
-random is used with -size. -random fills with Mersenne Twister random data (slightly slower).
-string: Use double quotes around the string data to make sure it gets seen properly. The quotes will be removed.
    You must select only 1 of these above 3 switches.  The last switch used will take priority.  default is for data to be filled wi
th 0x00.

-filesize is the file size and can be absolutely huge (I am not even sure that petasite 200 has a filesystem which can handle a full
 64-bit file size)! default is 0 and will create a 0-byte empty file. -filesize doesn't have to be an exact multiple of the data siz
e.
-repeat specifies the number of pattern repeats, if you specified -string or -word.  since random is currently only 1 byte wide.
    You can choose 1 of the above 2 switches or none at all, not both.  The last switch used will take priority.

-filepath default is ".\TESTFILE"

-h or -help or -? or /? or no arguments gives this help and exits.
/v or -v or -ver or -version gives the version number and exits.
Example: createfile -word 1 0xa5 0x5a -size 4700_MB -file zoop (creates a dvd-sized file named "zoop" with a word pattern)
Example: createfile -word 2 65520 0x0020 01234 12 65535 -size 47000000000 -filename "ploz.bin" (creates a dvd-sized file named "ploz
.bin" with a word pattern)
Example: createfile -string "STACK" -size 0x2000 (creates a file defaultly named "TESTFILE" filled with the string "STACK" 2000 HEX
bytes long.)
Example: createfile -random -size 2_TB -file test.bin (creates file named "test.bin")
Example: createfile -word 1 0 -size 257_GiB -filepath c:\t\filetoobigformemory  (makes a 257GiB file with zeros content that is
 too big for memory or VM, even on the fanciest workstation I've seen)
Performance: 0.439GB/minute on a SATA II 2TB 7200RPM drive. random is 0.34149GB/minute.
This software is good for testing limits and bugs in filesystems or just for making test files for programmers.
Copyright 1993 Jim Michaels,under GPL3 license.

biolerplate

gcc compiler note: -fpack-struct cannot be used with iostream or anything to do with libstdc++ (including locale which includes iostream) without getting lots of errors.

The dos version is compiled with DJ Delorie's djgpp (gcc for DOS). It can be obtained at DJDelorie.com/djgpp.

The windows version was compiled with mingw-w64. It is available at sf.net.


Copyright 1993 Jim Michaels

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.


Screenshots

createfile gui wrapper main window
createfile gui wrapper main window