Ejemplo n.º 1
0
        //Fills the drive specified by @drive
        public static void FillDrive(char drive)
        {
            throw new Exception("THINK VERY CAREFULLY BEFORE YOU DO THIS!");

            Int64 freeSpace;
            try
            {
                DriveInfo driveInfo = new DriveInfo(Convert.ToString(drive));// (@"C:");
                freeSpace = driveInfo.AvailableFreeSpace;
            }
            catch (System.IO.IOException e)
            {
                Console.WriteLine(e);
                return;
            }

            FileSplatter fs = new FileSplatter(Convert.ToString(drive) + @":\");

            //Create up [0, 100] dir trees under @drive, fill them with [100, 1000] files, for a grand total of @freeSpace bytes
            fs.Splatter(new Range<int>(0, 100), new Range<int>(100, 1000), freeSpace);
        }
Ejemplo n.º 2
0
        static void MainForSplatter(string[] args)
        {
            //TODO: Get rid of this shit so this can be scriptable
            Console.WriteLine("Input root directory to splatter files in:");
            string dir = Console.ReadLine();
            if (dir == "")
                dir = "C:\\tmp\\";

            //Actual Calling Convention
            //TODO: remove filepath from constructor so it can be error checked...
            FileSplatter fs = new FileSplatter(dir);

            //Create 5 new/random directory trees and splatter 5 new/random files across those and existing directories.
            //TODO: take these values as input
            Console.WriteLine("Splattering 5 new dir trees and 5 files randomly throughout " + dir);
            fs.Splatter(5, 5, new Range<int>(100, 100000));

            //Write log
            string logPath = Path.Combine(dir, "splatterLog.txt");
            Console.WriteLine("Log exported to: " + logPath);
            fs.ExportItemsCreatedList(logPath);

            //Give them time to read your splatter
            Console.WriteLine("Done!");
            Console.ReadLine();
        }