BadBlocksPlaceholder
BadBlocksPlaceholder copied to clipboard
Speed up the file creation
Hi!
The file creation is very slow, but the MS have a good alternative to speed up the process:
Original version of write dummy files:
using (var filestream = File.OpenWrite(filename))
{
filestream.Write(block, 0, blockSize);
filestream.Flush();
filestream.Close();
}
The new faster version:
using (var fileStream = new FileStream(filename, FileMode.CreateNew, FileAccess.Write, FileShare.None))
{
fileStream.SetLength(blockSize);
}
HVND!
Faster program execution is always better... How does it behave when creating a file on a bad sector?
Normally do nothing in the bad sector. When you can read the file with bad sectors, will see the read error.