throw error if user provides a directory as input to file related ops