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. Web Development
  3. ASP.NET
  4. Setting ACE is very slow for folder with many files and subfolders.

Setting ACE is very slow for folder with many files and subfolders.

Scheduled Pinned Locked Moved ASP.NET
security
4 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.
  • S Offline
    S Offline
    sumB
    wrote on last edited by
    #1

    Setting ACE is very slow for folder with many files and subfolders. My folder has 35602 files and 648 subfolders and SetAccessControl method needs 30 minute to remove a user from this folder. I am removing a user from the security tab of folder using following code. DirectoryInfo dirInfo = new DirectoryInfo(folderPath); DirectorySecurity fSecurity = dirInfo.GetAccessControl(AccessControlSections.All); fSecurity = CanonicalizeDacl(fSecurity); fSecurity.RemoveAccessRule(new FileSystemAccessRule(coworkerAccount, accessRight, AccessControlType.Allow)); dirInfo.SetAccessControl(fSecurity); SetAccessControl method takes a long time when the folder having many files.

    Mahendra

    L 1 Reply Last reply
    0
    • S sumB

      Setting ACE is very slow for folder with many files and subfolders. My folder has 35602 files and 648 subfolders and SetAccessControl method needs 30 minute to remove a user from this folder. I am removing a user from the security tab of folder using following code. DirectoryInfo dirInfo = new DirectoryInfo(folderPath); DirectorySecurity fSecurity = dirInfo.GetAccessControl(AccessControlSections.All); fSecurity = CanonicalizeDacl(fSecurity); fSecurity.RemoveAccessRule(new FileSystemAccessRule(coworkerAccount, accessRight, AccessControlType.Allow)); dirInfo.SetAccessControl(fSecurity); SetAccessControl method takes a long time when the folder having many files.

      Mahendra

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

      sumB wrote:

      SetAccessControl method takes a long time when the folder having many files.

      That is inevitable. Each file takes a finite amount of time, multiply that by 35602, plust the time taken to traverse 648 subdirectories, and you get a larger finite time.

      Veni, vidi, abiit domum

      S 1 Reply Last reply
      0
      • L Lost User

        sumB wrote:

        SetAccessControl method takes a long time when the folder having many files.

        That is inevitable. Each file takes a finite amount of time, multiply that by 35602, plust the time taken to traverse 648 subdirectories, and you get a larger finite time.

        Veni, vidi, abiit domum

        S Offline
        S Offline
        sumB
        wrote on last edited by
        #3

        Yes, I understand you concern but do we have any technique to overcome the time issue.

        Mahendra

        M 1 Reply Last reply
        0
        • S sumB

          Yes, I understand you concern but do we have any technique to overcome the time issue.

          Mahendra

          M Offline
          M Offline
          Manfred Rudolf Bihy
          wrote on last edited by
          #4

          The typical way I was taught in my days as an administrator was to use groups for file access rights. All that would be needed to remove an account from accessing the files was to remove them from the group, which in itsself is a quite speedy process. There is also nothing preventing you from having just a single account in such a group. The group access rights can be removed by some background process then after the last account from the group has been removed. Still, removing an account from that group will immeadiately keep that account from accessing the files. Hope that will help you in the future. Cheers!

          "I had the right to remain silent, but I didn't have the ability!"

          Ron White, Comedian

          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