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. how to check if a file exists in a directory
Forum Updated to NodeBB v4.3 + New Features

how to check if a file exists in a directory

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 2.0k 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.
  • R Offline
    R Offline
    russjohn834
    wrote on 15 Jul 2020, 11:22 last edited by
    #1

    Hi,
    How do I check whether a file exists in a given path or not in Qt?

    for ex, if my file location is:

    QString filePath = QCoreApplication::applicationDirPath()+"/data/filename.txt";
    
    J 1 Reply Last reply 15 Jul 2020, 11:24
    0
    • R russjohn834
      15 Jul 2020, 11:22

      Hi,
      How do I check whether a file exists in a given path or not in Qt?

      for ex, if my file location is:

      QString filePath = QCoreApplication::applicationDirPath()+"/data/filename.txt";
      
      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 15 Jul 2020, 11:24 last edited by
      #2

      @russjohn834 Documentation says: https://doc.qt.io/qt-5/qfile.html#exists

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      6
      • R Offline
        R Offline
        russjohn834
        wrote on 15 Jul 2020, 12:08 last edited by
        #3

        @jsulm thank you :)

        1 Reply Last reply
        1

        1/3

        15 Jul 2020, 11:22

        • Login

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