If you do not close it, you cannot guarantee that it will write out the last piece of data written to it. This is because it uses a buffer, and the buffer closes when the stream closes.
Secondly, it will lock the file as open, preventing another process from using it.
The safest way to use a filter is to use an instruction.
source share