Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFile exists return true for folders
Forum Updated to NodeBB v4.3 + New Features

QFile exists return true for folders

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 8 Offline
    8 Offline
    8majkel8
    wrote on last edited by
    #1

    Is it error or feature?

    @
    QUrl fileUrl("file://path/to/folder");
    QString fname = fileUrl.toLocalFile();
    if (QFile::exists(fname)) {
    //true for folders and files
    }
    @

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Alek Śmierciak
      wrote on last edited by
      #2

      A feature. Take a look "here":http://qt-project.org/forums/viewthread/14871.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SergioDanielG
        wrote on last edited by
        #3

        As I see, it's a feature, because folders, in fact, are special files.
        Regars

        www.ftatv.com.ar El foro argentino de la TV libre

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved