Skip to content

ScavyXYZ/File-Spamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File Spamer

A multithreaded C++ application for rapidly creating large files on Windows systems. This tool uses Windows API functions to efficiently create sparse files of 1GB each.

Features

  • Multithreaded file creation: Creates multiple files concurrently for improved performance
  • Large file support: Each file is created with a size of 1GB (1,073,741,824 bytes)
  • Performance timing: Built-in timer to measure execution time
  • Flexible operation modes: Create a specific number of files or run indefinitely
  • Custom naming: User-defined file naming with automatic numbering

Requirements

  • Platform: Windows (uses Windows API)
  • Compiler: C++17 compatible compiler (Visual Studio, MinGW, etc.)
  • Dependencies: Windows.h for file operations

Usage

  1. Compile the project:

    build.bat
  2. Run the executable:

    bin/FileCreator.exe
    
  3. Follow the prompts:

    • Enter number: Specify how many files to create (enter 0 for infinite mode)
    • Enter file name: Provide a base name for the files
  4. Output:

    • Files will be created in the current directory
    • Files are named as: [filename][number].dat
    • Execution time is displayed upon completion

Example

Enter number: 5
Enter file name: testfile
Created: testfile0.dat
Created: testfile1.dat
Created: testfile2.dat
Created: testfile3.dat
Created: testfile4.dat
Done! Time: 0.342

This creates 5 files named testfile0.dat through testfile4.dat, each 1GB in size.

How It Works

The application uses the Windows API's sparse file creation technique:

  1. Creates a file handle with CreateFileA()
  2. Sets the file pointer to 1GB using SetFilePointerEx()
  3. Sets the end of file marker with SetEndOfFile()
  4. The OS creates a sparse file without writing actual data

This method is extremely fast as it doesn't write actual data to disk, just reserves the space.

Warning

⚠️ Important Considerations:

  • Disk Space: Each file reserves 1GB. Ensure sufficient disk space before running
  • Infinite Mode: Setting number to 0 will create files indefinitely until manually stopped or disk space is exhausted
  • File Overwriting: Files with the same name will be overwritten without warning
  • Platform Specific: This code only works on Windows due to Windows API usage

Potential Use Cases

  • Testing disk performance
  • Simulating large file operations
  • Stress testing storage systems
  • Creating placeholder files for testing applications
  • Benchmarking multithreaded file I/O

About

creates a lot of files that take up disk space

Resources

License

Stars

Watchers

Forks

Packages

No packages published