Results 1 to 11 of 11

Thread: file name comparison

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 27 Times in 24 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: file name comparison

    You can try a heuristic that takes an existing file name, changes its case and uses QFile::exists() to check if the filesystem treats the two names as the same file.
    But as I said before file doesn't exist at the moment of comparison, therefore QFile::exists will not work, I suppose.

  2. #2
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: file name comparison

    You can not do it easily because you do not know the underlying file system. Regardless of OS, it is the file system you need to be worried about. On both Windows and Linux, you can have file systems which are case sensitive and case-insensitive. An application can not easily detect the file system.

Similar Threads

  1. QHash add comparison function, how?
    By holst in forum Qt Programming
    Replies: 9
    Last Post: 30th March 2010, 19:49
  2. SQL Select statement with binary comparison
    By xfurrier in forum Qt Programming
    Replies: 2
    Last Post: 21st June 2009, 02:33
  3. comparison of two pixmap images
    By sar_van81 in forum Qt Programming
    Replies: 5
    Last Post: 18th September 2007, 11:35
  4. String comparison
    By Sarma in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2006, 12:31
  5. case insensitive comparison.
    By munna in forum Newbie
    Replies: 1
    Last Post: 7th May 2006, 16:27

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.