Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. File or Folder

File or Folder

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
5 Posts 5 Posters 0 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.
  • A Offline
    A Offline
    Anil_vvs
    wrote on last edited by
    #1

    Hi All, Can anyone tell me how to find out whether a given path belongs to a file or folder in windows?? Thanks and Regards, Anil

    K M C H 4 Replies Last reply
    0
    • A Anil_vvs

      Hi All, Can anyone tell me how to find out whether a given path belongs to a file or folder in windows?? Thanks and Regards, Anil

      K Offline
      K Offline
      kk tvm
      wrote on last edited by
      #2

      Hi Anil Use FindFirst and FindNext function to find out the given path is file or folder Regards KK

      1 Reply Last reply
      0
      • A Anil_vvs

        Hi All, Can anyone tell me how to find out whether a given path belongs to a file or folder in windows?? Thanks and Regards, Anil

        M Offline
        M Offline
        Mila025
        wrote on last edited by
        #3

        Hi, You can use GetFileAttributesEx -> if dwFileAttributes from WIN32_FILE_ATTRIBUTE_DATA struct will have FILE_ATTRIBUTE_DIRECTORY - so it's directory ----------- Mila

        1 Reply Last reply
        0
        • A Anil_vvs

          Hi All, Can anyone tell me how to find out whether a given path belongs to a file or folder in windows?? Thanks and Regards, Anil

          C Offline
          C Offline
          Cool Ju
          wrote on last edited by
          #4

          hi, try CPath::IsDirectory(). But it is an ATL class. You have to include atlpath.h Adios, Cool Ju :cool: Dream Ur Destiny

          1 Reply Last reply
          0
          • A Anil_vvs

            Hi All, Can anyone tell me how to find out whether a given path belongs to a file or folder in windows?? Thanks and Regards, Anil

            H Offline
            H Offline
            Hamid Taebi
            wrote on last edited by
            #5

            WIN32_FIND_DATA m_data; HANDLE hFile; hFile=FindFirstFile(filename,&m_data) if(hFile==INVALID_HANDLE_VALUE) //file not found else FindClose(hFile);_**


            **_

            whitesky


            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups