title: Why does open("url") sometimes return File sometimes StringIO?
body: <p>I have two CSV files stored on S3. When I <code>open</code> one of them, a <code>File</code> is returned. When I <code>open</code> the other one, a <code>StringIO</code> is returned.</p>
  
  <pre><code>fn1 #=&gt; "http://SOMEWHERE.s3.amazonaws.com/setup_data/d1/file1.csv" 
  open(fn1) #=&gt; #&lt;File:/var/folders/sm/k7kyd0ns4k9bhfy7yqpjl2mh0000gn/T/open-uri20140814-26070-11cyjn1&gt; 
  
  fn2 #=&gt; "http://SOMEWHERE.s3.amazonaws.com/setup_data/d2/d3/file2.csv" 
  open(fn2) #=&gt; #&lt;StringIO:0x007f9718670ff0&gt; 
  </code></pre>
  
  <p>Why? Is there any way to open them with a consistent data type? </p>
  
  <p>I need to pass the same data type <code>String</code> into <code>CSV.read(open(file_url))</code>, which doesn't work if sometimes it's getting a <code>File</code> and sometimes a <code>StringIO</code>.</p>
  
  <p>They were created via different ruby scripts (they contain very different data).</p>
  
  <p>On my Mac, they both appear to be ordinary text CSV files, and they were uplaoded via the AWS console, and have identical permissions and identical meta data (content-type: application/octet-stream).</p>