Support the destination being a directory or a file