Prevent attempts to read closed files