manage file handles through raii