title: how to quickly verify the case sensitive filename really exists
body: <p>I have to make a unix compatible windows delphi routine that confirms if a file name exists in filesystem exactly in same CaSe as wanted, e.g. "John.txt" is there, not "john.txt".</p>
  
  <p>If I check "FileExists('john.txt')" its always true for John.txt and JOHN.TXT due windows .</p>
  
  <p>How can I create "FileExistsCaseSensitive(myfile)" function to confirm a file is really what its supposed to be.</p>
  
  <p>DELPHI Sysutils.FileExists uses the following function to see if file is there, how to change it to double check file name is on file system is lowercase and exists:</p>
  
  <pre><code>function FileAge(const FileName: string): Integer;
  var
    Handle: THandle;
    FindData: TWin32FindData;
    LocalFileTime: TFileTime;
  begin
    Handle := FindFirstFile(PChar(FileName), FindData);
    if Handle &lt;&gt; INVALID_HANDLE_VALUE then
    begin
      Windows.FindClose(Handle);
      if (FindData.dwFileAttributes and FILE_ATTRIBUTE_DIRECTORY) = 0 then
      begin
        FileTimeToLocalFileTime(FindData.ftLastWriteTime, LocalFileTime);
        if FileTimeToDosDateTime(LocalFileTime, LongRec(Result).Hi,
          LongRec(Result).Lo) then Exit;
      end;
    end;
    Result := -1;
  end;
  </code></pre>