Checks if file or dataset doesn't exist before reading/writing