I always use streamwriter writer = new StreamWriter(file) to write to file. The problem is it wont actually write to file until writer.close().
If between class create and class close something bad happens (and the program never reaches writer close), I wont get any information in the file. How to force write between create and close?