Click here to Skip to main content
14,243,903 members

Make-A-File - File Creation Utility

Rate this:
4.17 (23 votes)
Please Sign up or sign in to vote.
4.17 (23 votes)
4 Feb 2003Ms-PL
Utility to easily create files for testing purposes. Also supports creating really huge files.

Sample Image - Make-a-File.jpg

Introduction

Often we need test files during development, either to see how an application behaves with differently sized files or just as a "payload" for various tests.

The Make-A-File utility is written just for this purpose - to create files. They can be between 1 byte and 18 Eb (Exabytes, thats about 18.432.000.000.000.000.000 bytes) filled with garbage, random values or zeroes.

Usage

Choose a filename (type or click on the "..." button) and a size. The size is made up by the number in the size field and a unit from the dropdown list. The dropdown list offers Bytes, Kb, Mb, Gb, Tb, Pb and Eb (each being a 1000 times bigger than the previous). The resulting file size in bytes is shown in the field at the bottom.

The checkbox "Random content" fills the file with, who would have guessed this, random bytes. The "Quick Create" checkbox is used to create a file quick and filled with garbage. Technically it uses SetFilePointer() to set the end of the file, which results in nothing being written to the file but allocates the disk space for its contents.

Please see the MSDN for the implications.

By default, the quick create also checks the random content.

If you are using NTFS with file compression enabled, you can easily create a 10 Tb (or even bigger) file on any hard disk if you do not enable the random content or quick create options.

How this works?

Simple, if none of these options is enabled then the program will write a stream of zeroes to the disk which get compressed to literally nothing on the file system. Any file which contains only all the same bytes allocates only one unit for the directory entry.

Information

It is written with MFC under VC6 und is tested under W2k and XP Pro (but should run on any Win32 plattform). The archive contains a release executable and the source code.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)

Share

About the Author

Andreas Saurwein Franci Gonçalves
Chief Technology Officer
Brazil Brazil
No Biography provided

Comments and Discussions

 
Questionneed to make 5000 files Pin
Member 1207791822-Oct-15 2:38
memberMember 1207791822-Oct-15 2:38 
SuggestionIprovement : choose number of files to create. Pin
Михайло Ткачук5-Nov-12 10:28
memberМихайло Ткачук5-Nov-12 10:28 
Generalbugs Pin
Satelit21-Nov-07 0:16
memberSatelit21-Nov-07 0:16 
GeneralRe: bugs Pin
Andreas Saurwein Franci Gonçalves21-Nov-07 0:43
memberAndreas Saurwein Franci Gonçalves21-Nov-07 0:43 
GeneralJust what I needed! Pin
Ashtray36027-Aug-07 8:48
memberAshtray36027-Aug-07 8:48 
Generaltimer Pin
krathouse18-Apr-07 9:42
memberkrathouse18-Apr-07 9:42 
GeneralGreat for creating files for unit testing a download utility! Pin
Frog's Brain6-Jul-05 7:02
memberFrog's Brain6-Jul-05 7:02 
GeneralGreat Pin
Florent Geffroy21-Feb-05 22:00
memberFlorent Geffroy21-Feb-05 22:00 
GeneralGreat tool Pin
omegamsx8-Feb-05 1:37
memberomegamsx8-Feb-05 1:37 
GeneralHandy... Pin
Joel Holdsworth21-Sep-04 3:25
memberJoel Holdsworth21-Sep-04 3:25 
QuestionIt seems to crash when making a 12-Exabyte file :-( ?? Pin
Nitron5-Feb-03 15:48
memberNitron5-Feb-03 15:48 
AnswerRe: It seems to crash when making a 12-Exabyte file :-( ?? Pin
Andreas Saurwein Franci Gonçalves5-Feb-03 23:32
memberAndreas Saurwein Franci Gonçalves5-Feb-03 23:32 
QuestionWhat's your goal? Pin
A. Riazi5-Feb-03 1:52
professionalA. Riazi5-Feb-03 1:52 
AnswerRe: What's your goal? Pin
Andreas Saurwein Franci Gonçalves5-Feb-03 1:56
memberAndreas Saurwein Franci Gonçalves5-Feb-03 1:56 
GeneralRe: What's your goal? Pin
Roger Allen5-Feb-03 6:40
memberRoger Allen5-Feb-03 6:40 
GeneralRe: What's your goal? Pin
Andreas Saurwein Franci Gonçalves5-Feb-03 10:09
memberAndreas Saurwein Franci Gonçalves5-Feb-03 10:09 
GeneralRe: What's your goal? Pin
Jörgen Sigvardsson5-Feb-03 9:51
memberJörgen Sigvardsson5-Feb-03 9:51 
GeneralRe: What's your goal? Pin
Andreas Saurwein Franci Gonçalves5-Feb-03 10:07
memberAndreas Saurwein Franci Gonçalves5-Feb-03 10:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Article
Posted 4 Feb 2003

Stats

96.1K views
1.6K downloads
23 bookmarked