CharlesJB / ENCODExplorer

5 stars 4 forks source link

downloadEncode fails if the download directory is not the current directory. #27

Closed ericfournier2 closed 7 years ago

ericfournier2 commented 7 years ago

Presently, downloadEncode uses the following line to fetch the files:

download.file(url=paste0(encode_root, href), quiet=TRUE,
                                   destfile=fileName, method = "curl",
                                   extra = "-O -L" )

However, the -O flag for curl reads as follow:

-O, --remote-name

Write output to a local file named like the remote file we get. (Only the file part of the remote file is used, the path is cut off.)

The file will be saved in the current working directory. If you want the file saved in a different directory, make sure you change the current working directory before invoking curl with this option.

So whenever a user passes in a different directory as a target, curl ignores it, and the md5sum check fails since the file is now where it is expected to be.

CharlesJB commented 7 years ago

Fixed with 8160b039b238f39920dd162f425014dd908f3dd0