Deleting an open file is handled inconsistently #756
Labels
area: testinghelpers
Issues that address the testing helpers
state: ready to pick
Issues that are ready for being worked on
type: bug
Issues that describe misbehaving functionality
Describe the bug
When performing a
File.OpenWrite()
, followed byFile.Delete()
the current implementation executes this without giving any indication anything is wrong.even if attampting to perform a
filestream.Flush()
operation on the file that is deleted.To Reproduce
Steps to reproduce the behavior:
Expected behavior
From quick investigation, using the normal filesystem the results of the above would be different between windows and linux, but in any case will not match with the result that occurs here, which is that it all executes with no issue.
In windows the
fileSystem.File.Delete("somefile.txt");
call would fail with an exception noting that the file cannot be deleted as it is open.meanwhile on Linux it would appear to fail on the final
openfile.Flush();
call, noting that there is no longer any stream.The outcome of the operation should match one of these, but ideally should support both.
The text was updated successfully, but these errors were encountered: