Cool.

Does it always open it immediately before the write, and then close again?

Cheers