Utility resource creation that defers buffer disposal until point where node has been freed.
Writes the buffer content to a file when the node ends.
Writes the buffer content to a file when the node ends. The caller is responsible for eventually freeing the buffer! This is because we do not open a transaction after writing completes.