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. Other Discussions
  3. Article Writing
  4. Help!....I need a code to find a file is read only or not

Help!....I need a code to find a file is read only or not

Scheduled Pinned Locked Moved Article Writing
2 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.
  • G Offline
    G Offline
    Gnanakkumaran D
    wrote on last edited by
    #1

    Hi, I need a code to find if a file in Windows NT is read only or not. The file attribute is not marked read only, but it was made read only using the file security settings (i.e NTExplorer->File->RightMouseClick->Properties->Security->Add->Everyone->Read). I would appreciate if some one help me find a code which will look through the file ACL(Access Control List) and determine if a file is read only or not. Thanks Kumar

    L 1 Reply Last reply
    0
    • G Gnanakkumaran D

      Hi, I need a code to find if a file in Windows NT is read only or not. The file attribute is not marked read only, but it was made read only using the file security settings (i.e NTExplorer->File->RightMouseClick->Properties->Security->Add->Everyone->Read). I would appreciate if some one help me find a code which will look through the file ACL(Access Control List) and determine if a file is read only or not. Thanks Kumar

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      > I need a code to find if a file in Windows NT is read only > or not. The file attribute is not marked read only, but it > was made read only using the file security settings The file isn't read only, it's just that the user don't have the privs to read it. Please don't mix the two concepts of security and DOS flags from the early '80s. You are right you have to check the ACL(s), and this is not something I'd recommend if you only want to know if a user (you?) can read it or not. Just try to open it read-only and find out. GetLastError should give you an appropriate resonse. (without testing I'd say the only possible response would be ERROR_ACCESS_DENIED if you don't have the privs, but knowing MS...)

      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