title: Can't tell if a file exists on a samba share
body: <p>I know that the file name is <code>file001.txt</code> or <code>FILE001.TXT</code>, but I don't know which. The file is located on a Windows machine that I'm accessing via samba mount point. </p>
  
  <p>The functions in <code>os.path</code> seem to be acting as though they were case-insensitive, but the <code>open</code> function seems to be case-sensitive:  </p>
  
  <pre><code>&gt;&gt;&gt; from os.path import exists, isfile
  
  &gt;&gt;&gt; exists('FILE001.TXT')
  True
  
  &gt;&gt;&gt; isfile('FILE001.TXT')
  True
  
  &gt;&gt;&gt; open('FILE001.TXT')
  Traceback (most recent call last):
    File "&lt;console&gt;", line 1, in &lt;module&gt;
  IOError: [Errno 2] No such file or directory: 'FILE001.TXT'
  
  &gt;&gt;&gt; open('file001.txt')    # no problem
  </code></pre>
  
  <p>So, my questions are these: </p>
  
  <ol>
  <li><p>Is there a way to determine what the file name is without opening the file (or listing the directory that it's in)? </p></li>
  <li><p>Why is <code>open</code> case-sensitive when <code>os.path</code> isn't?</p></li>
  </ol>
  
  <hr>
  
  <p><strong>Update:</strong> thanks for the answers, but <a href="https://stackoverflow.com/questions/4036637/case-sensitivity-issues-with-mounted-samba-share">this isn't a python problem</a> so I'm closing the question. </p>