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 can I give write access to a file to all users? [modified]

How can I give write access to a file to all users? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
questiondelphi
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.
  • S Offline
    S Offline
    sashoalm
    wrote on last edited by
    #1

    I need to programatically give write-access to a file that is created by my program (which runs from an administrator account) to all users. How can I set the access-control lists for a file? I'm using CreateFile to create the file. [Edit] I'm talking about doing the equivalent of 'chmod a+w' to a file. How can I do that on Windows? I know NT has file permissions called ACL. Is this the way to do it?

    There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

    modified on Thursday, October 21, 2010 4:49 AM

    _ 1 Reply Last reply
    0
    • S sashoalm

      I need to programatically give write-access to a file that is created by my program (which runs from an administrator account) to all users. How can I set the access-control lists for a file? I'm using CreateFile to create the file. [Edit] I'm talking about doing the equivalent of 'chmod a+w' to a file. How can I do that on Windows? I know NT has file permissions called ACL. Is this the way to do it?

      There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal

      modified on Thursday, October 21, 2010 4:49 AM

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      One of the parameters of CreateFile is a security descriptor. Use this to control the access of the file. Here are some articles on how to use it - http://weblogs.asp.net/oldnewthing/archive/2004/03/12/88572.aspx[^] http://www.codeproject.com/KB/winsdk/accesscontrollists.aspx[^]

      «_Superman_»
      I love work. It gives me something to do between weekends.

      Microsoft MVP (Visual C++)

      Polymorphism in C

      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