Walking the file system
From: BCDesign (BCDesign_at_discussions.microsoft.com)
Date: 08/31/04
- Next message: Robert Schuldenfrei: "New concurrency error"
- Previous message: Jon Skeet [C# MVP]: "Re: Local var passed to thread. May it get reclaimed by GC???"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 31 Aug 2004 13:47:01 -0700
I wasn't sure where the best place to post this was so I am starting here,
and if anyone can point me to a better group, I'd appreciate it.
The problem I have is that I want to reset permissions on a large number of
files and folders during an overnight process. There are about 5000 users
who maintain their My Documents folder on the server, and because of copying
and moving issues, permission regularly get messed up. As such, I would like
to write a process that can run nightly to go through these files and folders
and reset all permissions back to what they should be.
There are two problems I am encountering and would like help with. One is
the fastest way to retrieve a list of all the files and folders, about 3
million total. I know that I can do this with DirectoryInfo objects, but I
would assume there is some overhead in the creation of these objects, and
while not a big deal normally, it can add up with 3 million files and folders
to sort through. Is there a system call that can retrieve a list of files
and folders quickly? Would it benefit me to have a C++ class that constructs
a string array for me and passes it back to the C# code? If so, what would
be the best system call for doing this quickly?
Second is the setting of permissions. Is it faster to try to check and
compare the permissions and only set the ones that need it, or is it faster
to just set the needed permissions regardless of how they are currently set?
Overwriting permissions is just fine, so either solution would work. The
question is just one of speed.
Any help anyone could provide me on this issue would be greatly appreciated.
Thanks,
Benjamin R. Carleski
- Next message: Robert Schuldenfrei: "New concurrency error"
- Previous message: Jon Skeet [C# MVP]: "Re: Local var passed to thread. May it get reclaimed by GC???"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|