Test File Generator
Version: 1.0.1.1-20041204

© 2004 - Alfred P. Reaud, Happy Cat Technologies

Released under the GNU General Public License, Version 2.

 

Table of Contents:

  1. Introduction.
  2. Algorithm.
  3. User Interface.
  4. Cautions.
  5. Prohibited Operations.
  6. Installation and Rebuilding.
  7. Known Bugs and Other.
  8. Download GNU-GPL licensed source code and executable.

Introduction:

This is the first release of the TestFileGenerator.  Developed in conjunction with File Cleaner as a test file generation tool, it is freeware, and is for use in verification and debugging of files that would operate on temporary internet files.  Primarily developed for the Windows XP platform, TestFileGenerator simulates dat, cookie, gif, and html files in the Microsoft® Internet Explorer (IE) temporary internet file areas.  TestFileGenerator is also capable of generating random character files in a user-designated folder.  You may use it concurrently with IE, as it does not modify any files being used by IE (please see the Known Bugs and Other Section for further information).

This author found the need, while developing File Cleaner, for a Windows application that generated test files without having to be on-line, browsing through numerous pages to get a sample test file set.  Browsing was inefficient, and unnecessarily consumed connection bandwidth, and sometimes the need for test files in a known folder arose.  The intent of TestFileGenerator is to address those needs, doing so with a user-friendly interface.
 

Algorithm:

TestFileGenerator was developed using the Dev-Cpp C++ IDE (Integrated Development Environment) Dev-C++ 4.9.9.0, and the FLTK (Fast Light Tool Kit) utility.  TestFileGenerator is a standalone program designed for the Windows XP operating system.

TestFileGenerator, with Find Temporary Internet Folders selected, recursively searches for the folders "Temporary Internet Files", "History", "Cookies", "Content.IE5", and "History.IE5", starting from the folder "C:\Documents and Settings".  TestFileGenerator insures that no folder names are duplicated in the search, as in example, "Content.IE5" is a subfolder of "Temporary Internet Files".   TestFileGenerator also allows the user to select a designated folder and to select the number of files to be generated, their average size, their size spread around the average value, and depending on which mode is in use, the extension type of the files.

There are two modes of operating to TestFileGenerator:

  1. Create Files in Temporary Internet Folders.  This is the mode of operation used when the Find Temporary Internet Folders radio button is enabled.  It scans the folders where IE is known to have placed temporary files and generates test files in that area, spaced approximately evenly throughout the folders with special emphasis on sub-folders of Content.IE5 and History.IE5.

    TestFileGenerator generates HTML files, TestFilexxx.htm, and corresponding GIF files, TestFilexxx.gif, counted as two files, in folders corresponding to the places where IE places temporary internet files, i.e. Content.IE5 and sub-folders of Content.IE5.   xxx corresponds to the instant file count in the given folder when the file is written.  Opening the HTML file should show a valid HTML page with an imbeded image and a displayed creation time that matches the actual file creation time.  TestFileGenerator will also place simulated cookie files, TestFilexxx.txt in the places where IE places cookies, such as in the Cookies folders.  Finally, TestFileGenerator will place simulated data files, TestFilexxx.dat, in places where IE creates an index.dat or other binary data files.  This dat file is always a determinate 1638 bytes long, composed of random characters.
     
  2. Create Files in User-Designated Folder.  This is the mode of operation used when the Find Temporary Internet Folders radio button is disabled. TestFileGenerator creates random character files in the designated folder, using the rand() function to generate the contents of the new files, and to determine the actual deviation of that file from the average size.  It is highly recommended that you first use TestFileGenerator in this mode to insure compatibility with the operating system installed on your computer.
     

User Interface:

The user interface is straightforward.  Figure 1 shows the user interface as it appears on startup, user-designated folder mode, with the default entries in their respective input boxes.  Figure 2 shows the user interface after completion of a 100 file write to the folder "d:\test", with the average file size set for 10000 ±5000 bytes.  This resulted in 100 random character files being generated in the folder, with the smallest being 5060 bytes and the largest being 14980 bytes.  The average size (computed in Excel) was 10295 bytes and the population standard deviation was 2624 bytes.

Figure 3 shows the same entries in the input boxes and Figure 2, however we now have the Find Temporary Internet Folders radio button enabled.  Please observe that some of the inputs are now disabled.  This is because they are not pertinent in temporary internet folders mode.  The only pertinent box is the count of files to generate.  Figure 4 appears the same, however, observe the command buttons.  Cancel and OK are disabled and ABORT is enabled.   In Figure 4, we are waiting for the user to press the Enter key or depress the OK button in Figure 5, which is an information window that pops to indicate to the user the general areas where the files where created and the counts in each area.  The plethora of files in the folder "Content.IE5" is due to there being 4 sub-folders to "Content.IE5" not including itself.  TestFileGenerator attempts to spread the files evenly among temporary internet folders, however it is not possible, in advance to know exactly the count that will occur in a given folder.  Also, as TestFileGenerator is actually writing two files for every htm file generated, the htm file itself and a gif file that corresponds to it, the spread of files will be skewed towards the sub-folders.

Test File Generator user interface on startup.
Figure 1

Test File generator user interface after processing in user-defined folder mode.
Figure 2

Test File Generator in find temporary internet folder mode.
Figure 3

Test File Generator in find temporary internet folder mode awaiting user entry after completion.
Figure 4

Test File Generator in find temporary internet folder mode post-creation information window.  Figure 5

  The user interface detailed description is as follows (all user inputs have tips associated with them):

  1. Find Temporary Internet Folders:  With this button depressed, TestFileGenerator will operate in the IE temporary Internet file area.  Depressing this button disables the Folder to use, File type to use, Average Size(B), and Size Spread(B) input boxes.  Releasing this radio button re-enables those input boxes.  If you don't depress this button then you must enter a valid folder name in the Folder to use text box or you will get a warning window.
     
  2. Folder to use:  An input text box for the name of the folder on which you wish to create the files in.  No Enter or Return is required.  However, valid Windows folder names are required, and testing is done to insure that the name is valid.  If the folder isn't present, a prompt window opens asking if you wish to create this folder.  Either use the mouse or the keyboard to respond.  Enter is equivalent to Yes, and space (the default, indicated by the dashed lines), indicates No.  Any syntactical errors in this dialog box will result in a warning window popping up explaining the error.  Further, certain folders are prohibited, discussed in the prohibited operations section.
     
  3. File type to use:  This text input box is for entry of a file extension.  Extensions are actually not required and it is provided for convenience.  It also simplifies viewing of the created files, as txt is associated with Microsoft® Notepad, doc is associated with Microsoft® Word, etc.  This text input box is disabled if Find Temporary Internet Folders is enabled.
     
  4. Count of files:  This is the count of files that TestFileGenerator is to create.  The minimum value of this numeric input box is one, and the maximum value is 1000.  Entries that exceed those limits will give a warning window and are automatically corrected to fit the corresponding minimum or maximum.  Entries that are decimal are allowed, however only the integer part of the entry is used. 
     
  5. Average Size(B):  This is the average size in bytes of the files to be generated by TestFileGenerator.  The minimum value is 1000, and the maximum value is 1000000.  Entries that exceed those limits will give a warning window and are automatically corrected to fit the corresponding minimum or maximum.  Entries that are decimal are allowed, however only the integer part of the entry is used.  This numeric input box is disabled if Find Temporary Internet Folders is enabled.  As the actual file size is computed by the formula Average Size ±(rand()*Size Spread)), there will never be a determinate output file size unless Find Temporary Internet Folders is enabled.  However, the spread of file sizes should match a bell curve centered on Average Size.
     
  6. Size Spread(B)This is the maximum spread size in bytes of files created by TestFileGenerator while not in create files in temporary internet folders mode.  The minimum value is 250, and the maximum value is 250000.  Entries that exceed those limits will give a warning window and are automatically corrected to fit the corresponding minimum or maximum.  Entries that are decimal are allowed, however only the integer part of the entry is used.  This numeric input box is disabled if Find Temporary Internet Folders is enabled.  Any file created will be within the range of sizes Average Size ± Size Spread, it's actual size determined by two random number operations.   Further, Size Spread must be less that Average Size - 1, which is to prevent loop overflow happening because a loop counter was given a negative value.  Entries that violate this constraint will give a warning window and are automatically corrected to fit within the constraint.
     
  7. Progress:  This widget shows the progress of TestFileGenerator.  Its progress depends on the count of files, the options selected, the speed of your disk drive and computer, and on any system, disk, and processor resources consumed by other applications that are active at the same time.
     
  8. Cancel:  This button cancels TestFileGenerator, similar to the Window Close Window Close button image. button.  Use either to terminate the application.
     
  9. OK:  This button starts processing of the named folder or the temporary Internet file area respective of the input box values.  Depressing this button also disables all other user input except for the ABORT button.  However the Window Close, Window Close button image., and Window Iconize, Window Iconize button image., buttons are still active.
     
  10. ABORT:  This button aborts any processing that is currently occurring at the end of the current media write.  Depress this button immediately if you change your mind about creating files in the area TestFileGeneratoris is operating in.  This button also re-enables all user inputs except those listed in the Find Temporary Internet Folders radio button description, above, depending on it's state.  However, see the cautions section for further information.
     


Cautions:

Please be cautious with the use of TestFileGenerator .  Though this is a benign application, you may accidentally fill a folder with test files.  This will not hurt your computer or it's operation, but can be a mild nuisance to correct.  Hence the limitations on file counts, average file size, and file size spread.   Also be aware TestFileGenerator may fill a hard disk or removable media such as a flash drive with test files, and will easily fill a floppy disk with test files.  Assuming that you set the file count to 1000, the average size to 1000000 bytes, and the size spread to 250000 bytes, this will result in a total character count ranging from 750,000,000 (750MB) to 1,250,000,000 (1.25GB) bytes.  While checking for available space does occur, that won't prevent that available space from being filled up if there is enough to process the configuration you entered in the numeric input boxes.

This author doesn't recommend that you use TestFileGenerator on CD-R, CD-RW, or DVD drives as they have not been tested.  Pass-thru operation may not work, or many not work as advertised on optical media drives that allow pass-thru, as TestFileGenerator uses low level forced flushing to the media which may not be compatible with a pass-thru optical drive.  Further, this author is not and will not be responsible for careless, negligent, and/or malignant use by any individual who uses TestFileGenerator.  Please see the GNU General Public License for more details.

Also, please be aware that TestFileGenerator does not operate on read-only or locked files.  Please be aware that TestFileGenerator, while in create files in temporary internet folders mode, only operates on folders used by Microsoft® Internet Explorer (IE), and does not operate on folders used by other Internet browsers, such as Mozilla, Opera, etc., unless they use the same folders as IE.  Finally, with the above two paragraphs in mind, please be sure that you actually want to do what you configured TestFileGenerator to do before you press that OK button!
 

Prohibited Operations:

With the cautions section in mind, certain files and folders where prohibited from being used, as follows:

  1. The folders "C:\", and any folders containing the text "drivers",  "system", "windows", "winnt", "documents and settings", and "program files" are prohibited from being used as targets for operation.  This is for obvious reasons, dealing with system security.
     
  2. TestFileGenerator will not use folders that contain the text "sys" or "admin", in a case insensitive sense.  Again, this is for obvious reasons.
     
  3. No temporary Internet folders are bypassed, other than the one listed below, as intelligent folder search has been implemented.  This allows for further utility among systems that do not use standard folder naming.  However, if you don't have ownership of the folder in question, TestFileGenerator will not create files in it.
     
  4. The folder "Content.MSO" is bypassed as it contains Microsoft® System Objects such as Windows Media Files that are needed by certain Windows applications.


Installation and Rebuilding:

This application may be installed in any folder.  To install, extract TestFileGenerator.exe from TestFileGenerator_1.0.1.1-20041204.zip to the folder of your choice.  "C:\Windows" is the recommended location for Windows applications.  You can then create a shortcut to it by right clicking on the Desktop and selecting New -> Short Cut to create a desktop shortcut to TestFileGenerator. 

A good way to test the operation of this software on your system is to create 100 files in a nonexistent user-designated folder, with an extension of txt, rtf, or doc.  Insure that 100 files where created and that the size spread matches what you entered.  If you're exhibiting a need for TestFileGenerator then you already know how to code and are familiar with advanced user concepts, so I won't get into the use of grep, od, wc, and other useful Linux/Unix commands that have ported over to the Windows operating system.

Rebuilding TestFileGenerator requires a C++ compiler such as Dev-C++ (freeware),  Microsoft® Visual C++ ($109USD from MSDN) or any other compatible C++ compiler.  The only caveat is that it must accept FLTK include files and libraries.  All necessary TestFileGenerator source and header files are included in TestFileGenerator_1.0.1.1-20041204.zip.  The author recommends that if you are using Dev-C++ that you extract the TestFileGenerator source files to a folder in the same location as devcpp.exe.  Regardless, I also recommend that you extract the all the source files to their own project folder for ease of use and visibility.

If you are using Dev-C++, you will need to reconfigure the Project Options -> Parameters -> Linker to point to the correct locations of the required library files.  If you followed the recommendation on where to place the files in the preceding paragraph, then it's a simple matter to change the text "../Dev-Cpp" to "../" which points the compiler to the correct required library location.  One would think that the compiler could figure this out, but Dev-C++ doesn't, for whatever reason.  The required library files are listed at the top of the header file TestFileGenerator.h, with the required header files following thereafter.  This author did not use Visual C++, and therefore cannot comment on whether it will compile correctly on it.  TestFileGenerator has been designed using standard C++ header files and run time libraries, so it should be straightforward to rebuild TestFileGenerator using Visual C++.  However, the author of TestFileGenerator can't guarantee that!

This author would recommend that Linux/Unix users not attempt to use TestFileGenerator, as it's designed with Windows XP in mind.  However, with some work, it you should be able to implement TestFileGenerator in any operating system.

TestFileGenerator has been verified on the following operating systems and machines:

  1. Windows XP Professional Version 5.1.2600 Service Pack 1 Build 2600
    1. Dell Optiplex GX260
    2. Dell Optiplex GX280
    3. Dell Dimension 8300
       
  2. Windows XP Home Version 5.1.2600 Service Pack 1 Build 2600
    1. Dell Dimension 2400
       
  3. Windows 2000 Professional Version 5.0.2195 Service Pack 4 Build 2195
    1. Dell Optiplex GX240
       

Known Bugs and Other:

As of the time this release TestFileGenerator has no bugs known to the author.  Please contact the author if you find a bug.  Also, if you wish to see this application updated for previous versions of Microsoft® Windows, or any other browser for that matter, please contact me with the pathnames of the proper temporary Internet file folders, and I'll modify the software to suit that operating system or browser version. 
 

Download GNU-GPL Licensed Source Code and Executable.

Requires WinZip 8.0® or a compatible un-zipper such as 7Zip.

Download TestFileGenerator_1.0.1.1-20041204.zip now (212KB).   Winzip 8.0 CRC for TestFileGenerator.exe is 5AC4A8ED.

TestFileGenerator has 1251 lines of code and took approximately 60 hours to develop.  Hopefully, you found or will find TestFileGenerator useful.  If you did, then a small voluntary donation would be appreciated to defray the costs of hosting a website at Yahoo! Geocities and for the hours expended developing TestFileGenerator.


Back To Home Page
© 2004
Alfred P. Reaud
Independent Investigator
Created: Wednesday, December 8, 2004
Current: Wednesday, December 8, 2004
Valid HTML 4.01!
Official PayPal Seal