Safe file download with platform-specific handling
safe_download(
url,
destfile,
mode = "wb",
quiet = FALSE,
timeout = 600,
max_retries = 3
)0 if successful, error code otherwise
URL to download from
Destination file path
"wb" for binary, "w" for text
Logical indicating whether to show progress
Timeout in seconds
Maximum number of retry attempts