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 whether a directory is write protected or not?

How to check whether a directory is write protected or not?

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

    Hi, How to check whether a directory is write protected(not ready-only attribute) or not. I tried using _taccess_s but its not working for directories(MSDN confirms it). Is there any way to check it. Thanks. Adios, Cool Ju :cool: Dream Ur Destiny

    S L 2 Replies Last reply
    0
    • C Cool Ju

      Hi, How to check whether a directory is write protected(not ready-only attribute) or not. I tried using _taccess_s but its not working for directories(MSDN confirms it). Is there any way to check it. Thanks. Adios, Cool Ju :cool: Dream Ur Destiny

      S Offline
      S Offline
      Sarath C
      wrote on last edited by
      #2

      Use GetFileAttributes function -Sarath

      C 1 Reply Last reply
      0
      • S Sarath C

        Use GetFileAttributes function -Sarath

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

        Hi, GetFileAttribute doesnot retrieve the write-protection setting. Thats why I specifically mentioned "not read-only attribute" in my post. Thanks. Adios, Cool Ju :cool: Dream Ur Destiny

        1 Reply Last reply
        0
        • C Cool Ju

          Hi, How to check whether a directory is write protected(not ready-only attribute) or not. I tried using _taccess_s but its not working for directories(MSDN confirms it). Is there any way to check it. Thanks. Adios, Cool Ju :cool: Dream Ur Destiny

          L Offline
          L Offline
          led mike
          wrote on last edited by
          #4

          See Access Control List MSDN Security Glossary[^]

          "What classes are you using ? You shouldn't call stuff if you have no idea what it does"
          Christian Graus in the C# forum

          led mike

          C 1 Reply Last reply
          0
          • L led mike

            See Access Control List MSDN Security Glossary[^]

            "What classes are you using ? You shouldn't call stuff if you have no idea what it does"
            Christian Graus in the C# forum

            led mike

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

            Thanks Mike, I got it. Its a combination of APIs. Lot of code. But its working fine. Adios, Cool Ju :cool: Dream Ur Destiny

            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