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. I can get the file name of a specific path, is there a way to know the type of the file?
Qt 6.11 is out! See what's new in the release blog

I can get the file name of a specific path, is there a way to know the type of the file?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 269 Views
  • 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.
  • I Offline
    I Offline
    IknowQT
    wrote on last edited by
    #1

    I can get the file name of a specific path, is there a way to know the type of the file?

    You can get file information with entryInfoList of qdir. Conversely, is there a way to tell if a file is a folder or a file by the name of the file?

    Christian EhrlicherC JonBJ 2 Replies Last reply
    0
    • I IknowQT

      I can get the file name of a specific path, is there a way to know the type of the file?

      You can get file information with entryInfoList of qdir. Conversely, is there a way to tell if a file is a folder or a file by the name of the file?

      Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by Christian Ehrlicher
      #2

      @IknowQT said in I can get the file name of a specific path, is there a way to know the type of the file?:

      is there a way to tell if a file is a folder or a file by the name of the file?

      QDir::entryInfoList() returns a container with QFileInfo - objects where you can get the information from.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      4
      • I IknowQT

        I can get the file name of a specific path, is there a way to know the type of the file?

        You can get file information with entryInfoList of qdir. Conversely, is there a way to tell if a file is a folder or a file by the name of the file?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @IknowQT said in I can get the file name of a specific path, is there a way to know the type of the file?:

        is there a way to tell if a file is a folder or a file by the name of the file?

        How would that be? Can you tell whether something is a file or a folder from its name? Say it's called foo, is that a file or a directory?

        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