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. How to check if folder/drive is valid?

How to check if folder/drive is valid?

Scheduled Pinned Locked Moved C / C++ / MFC
sysadmintutorialquestion
5 Posts 2 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.
  • K Offline
    K Offline
    khb
    wrote on last edited by
    #1

    Hi altogether! I'm trying to check whether a given path of a folder (also on the network or just a drive) really exists. I'd like to do this without using the Shlwapi.dll, but I have no idea how to do this. Any ideas? Thank you very much, Marcus.

    D 1 Reply Last reply
    0
    • K khb

      Hi altogether! I'm trying to check whether a given path of a folder (also on the network or just a drive) really exists. I'd like to do this without using the Shlwapi.dll, but I have no idea how to do this. Any ideas? Thank you very much, Marcus.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      _access()
      _stat()
      CFile::GetStatus()
      GetFileAttributes()

      can all be used.


      A rich person is not the one who has the most, but the one that needs the least.

      K 1 Reply Last reply
      0
      • D David Crow

        _access()
        _stat()
        CFile::GetStatus()
        GetFileAttributes()

        can all be used.


        A rich person is not the one who has the most, but the one that needs the least.

        K Offline
        K Offline
        khb
        wrote on last edited by
        #3

        I just tried CFile::GetStatus(), but this doesn't work for network locations. But I think one of the other functions will do the job. Thank you very much!

        D 1 Reply Last reply
        0
        • K khb

          I just tried CFile::GetStatus(), but this doesn't work for network locations. But I think one of the other functions will do the job. Thank you very much!

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          khb wrote: I just tried CFile::GetStatus(), but this doesn't work for network locations. Correct. I did not bother to read the docs (fine print) for each function I mentioned. I just wanted to throw a bunch of them out on the table so you would have plenty to choose from.


          A rich person is not the one who has the most, but the one that needs the least.

          K 1 Reply Last reply
          0
          • D David Crow

            khb wrote: I just tried CFile::GetStatus(), but this doesn't work for network locations. Correct. I did not bother to read the docs (fine print) for each function I mentioned. I just wanted to throw a bunch of them out on the table so you would have plenty to choose from.


            A rich person is not the one who has the most, but the one that needs the least.

            K Offline
            K Offline
            khb
            wrote on last edited by
            #5

            No problem. My intention was not to bother you. I just wanted to share what I found out for the case that anybody else reads this thread (maybe because he has the same problem to solve). Thanks again for your help!

            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