Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't read a file that contains a question mark in name
    primarykey
    data
    text
    <p>I have a file with a name something like: <code>/path/to/file/dir with spaces/mytiff-?.tif</code>. In irb I try both the following:</p> <pre><code>open("/path/to/file/dir with spaces/mytiff-?.tif", 'rb') File.open("/path/to/file/dir with spaces/mytiff-?.tif", 'rb') </code></pre> <p>And I'm getting an error:</p> <pre><code>Errno::ENOENT: No such file or directory. </code></pre> <p>I've also tried replacing the <code>?</code> with <code>\?</code> in the string.</p> <p>I'm using ruby 2.0.0. File is network drive (CIFS), client is a mac (lion). </p> <p><strong>Update</strong></p> <p>Thanks for the help. The problem is still not solved. </p> <pre><code>$ ls "/Volumes/rmrpp/MLP Library/Bridgland 1927 - North Saskatchewan/Stations/420/Repeat Masters/" HIG2008_B27_420-100.tif HIG2008_B27_420-90.tif HIG2008_B27_420-92.tif HIG2008_B27_420-94.tif HIG2008_B27_420-96.tif HIG2008_B27_420-98.tif HIG2008_B27_420-?.tif HIG2008_B27_420-101.tif HIG2008_B27_420-91.tif HIG2008_B27_420-93.tif HIG2008_B27_420-95.tif HIG2008_B27_420-97.tif HIG2008_B27_420-99.tif $ irb 1.9.3p194 :001 &gt; t = File.open("/Volumes/rmrpp/MLP Library/Bridgland 1927 - North Saskatchewan/Stations/420/Repeat Masters/HIG2008_B27_420-?.tif",'rb'); nil Errno::ENOENT: No such file or directory - /Volumes/rmrpp/MLP Library/Bridgland 1927 - North Saskatchewan/Stations/420/Repeat Masters/HIG2008_B27_420-?.tif from (irb):1:in `initialize' from (irb):1:in `open' from (irb):1 from /Users/mlp/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `&lt;main&gt;' 1.9.3p194 :002 &gt; t = File.open("/Volumes/rmrpp/MLP Library/Bridgland 1927 - North Saskatchewan/Stations/420/Repeat Masters/HIG2008_B27_420-98.tif",'rb'); nil =&gt; nil 1.9.3p194 :003 &gt; t.size =&gt; 50124180 </code></pre> <p>As you can see, the file exists (I'm listing it in bash). I go into irb and try to read the file as a binary. The file path is quoted. It fails. I try another file from the same directory and it works.</p> <p>I think @mu_is_too_short is correct. Maybe the ? isn't a question mark at all. The only viable solution I can think of is to manually rename the files with the mystery question mark. Any other ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload