Bug in get.pdb() when file does not exist, an empty local file still gets created

Issue #76 resolved
Barry Grant created an issue

There is a confusing creation of a local file even though an error is thrown due to missing server file. e.g.

> file.exists("9zzz.pdb")
[1] FALSE
> i <- get.pdb("9zzzz")
trying URL 'http://www.rcsb.org/pdb/files/9zzz.pdb'
Error in download.file(get.files[k], put.files[k], quiet = !verbose) :
  cannot open URL 'http://www.rcsb.org/pdb/files/9zzz.pdb'
In addition: Warning messages:
1: In get.pdb("9zzzz") :
  ids should be standard 4 character PDB-IDs: trying first 4 characters...
2: In download.file(get.files[k], put.files[k], quiet = !verbose) :
  cannot open: HTTP status was '404 Not Found'

> i
[1] "./9zzz.pdb"

> file.exists("9zzz.pdb")
[1] TRUE

Comments (1)

  1. Log in to comment