Skip to content

When download.file fails...

1 message · CHD850

#
Hi everyone, 

In the situation that the remote file does not exist, download.file fails,
yet it still creates a file as provided for "destfile" argument. I tried to
delete this bad file but got the message that it is still being used by
"other programs", which I assume is R. 

Does anyone know how to avoid this problem? Potential solutions I can think
of now is either checking the existence on remote server before using
download.file, or change download.file's behavior, or use other functions.
Any suggestions are appreciated. 

Stanley