title: Getting error in file(file, “rt”): cannot open the connection
body: <p>I am trying to download a zip file from the google patent bulk data website <a href="http://storage.googleapis.com/patents/grantbib/2014/ipgb20140107_wk01.zip" rel="nofollow noreferrer">http://storage.googleapis.com/patents/grantbib/2014/ipgb20140107_wk01.zip</a>, unzip the file and read the table. I used this procedure <a href="https://stackoverflow.com/questions/3053833/using-r-to-download-zipped-data-file-extract-and-import-data">Using R to download zipped data file, extract, and import data</a> </p>
  
  <pre><code>setwd("/var/folders/gk/n1wfrbqx6ss4x3vz7qp9lf3c0000gn/T//RtmpG7LUSs")
  temp &lt;- tempfile() 
  download.file("http://storage.googleapis.com/patents/grantbib/2014/ipgb20140107_wk01.zip",temp)
  data &lt;- read.table(unz(temp, "ipgb20140107_wk01.dat"))
  unlink(temp)
  </code></pre>
  
  <p>and I tried to set the working directory to the same place as the temporary file similar to what is suggested in here <a href="https://stackoverflow.com/questions/49090622/getting-error-in-filefile-rt-cannot-open-the-connection">Getting error in file(file, &quot;rt&quot;): cannot open the connection</a> but I still get the same error message:</p>
  
  <pre><code>    Error in open.connection(file, "rt") : cannot open the connection
  In addition: Warning message:
  In open.connection(file, "rt") :
    cannot locate file 'ipgb20140107_wk01.dat' in zip file '/var/folders/gk/n1wfrbqx6ss4x3vz7qp9lf3c0000gn/T//RtmpG7LUSs/file476796049c7'
  </code></pre>