Once file is open, it should be closed:
Stream fs = new FileStream(file name, FileMode.Create );
try {
// write, exceptions may raise here
} finally {
fs.Close();
}
What should one do to remove the file in case of an error?
Stream fs = new FileStream(file name, FileMode.Create );
try {
// write, exceptions may raise here
} finally {
fs.Close();
}
What should one do to remove the file in case of an error?
Comment