I am writing many .csv files to my hard drive to log some measurement data using the StreamWriter
and CsvHelper
from Josh Close class:
using (TextWriter writer = new StreamWriter(path,true))
using (CsvWriter = new CsvWriter(writer))
{
writer.WriteLine("1...");
/// ...
/// ...
/// ...
writer.Flush();
}
Overnight their can be up to 500 MB of data stored. So today this question bothers me: What will happen if my hard drive or USB drive has no more empty space and I want to write a new file? And what is a best practice to prevent this situation? Will this throw an exception or not? I found nothing in the .NET documents about this situation.