NullFileNET – NullFile in .NET way or zeroing disk for Windows in VirtualBox

Updated version 0.2
Exception catched on file object disposing.
———————

I have some VMs with VirtualBox, I use to run nullfile-1.02.exe by Matthias Jordan in order to clear unused sectors with a VBoxManage compact.

It’s a good tool, but I want to know more infos, first of all, when app thinks to finish to wipe?
I remember to see nullfile sources in pascal, great language, I want to thanks Matthias Jordan because he shares it.

I need a faster application to do this work…
… Think .NET …
So I decide to write a very similar command line app, with some new statistical features:

Download NullFileNET source and binary (.exe), and here only binary (.exe).

I can resume code lines that do the work in:

string filename = "appleapplebananacoffee";
byte[] bArray = new byte[1024];
FileStream zeroingFile = File.Create(filename, 1024, FileOptions.DeleteOnClose);
while (true)
   zeroingFile.Write(bArray, 0, 1024);

Have a good 2011!!!

P.S.: There is a thing I’ve not understand, when process finish, it seems to throw an ex on a lower level than main call, but I think it’s because of low disk space; when I have another slice of time I’ll try to solve this.

VN:F [1.9.15_1155]
Rating: 10.0/10 (3 votes cast)
VN:F [1.9.15_1155]
Rating: 0 (from 0 votes)
NullFileNET - NullFile in .NET way or zeroing disk for Windows in VirtualBox, 10.0 out of 10 based on 3 ratings

One Response to “NullFileNET – NullFile in .NET way or zeroing disk for Windows in VirtualBox”

  1. vm says:

    thank you for your good utility
    i’ve tested with success and save a lot of space.

    VA:F [1.9.15_1155]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.15_1155]
    Rating: +1 (from 1 vote)

Leave a Reply