datalogger for counter sensor with RTC HELP!

You open the file. Where do you close it?