Get defensive about opening files which may not exist.