In my app I'm creating folders for archiving old stuff from a harddisc.
When creating a new folder I must copy all NTFS rights (Groups / Users) from the source folder to the newly created destination folder.
Here is what I've written so far:
FileSecurity fileSecurity =
File.GetAccessControl(filenameSource, AccessControlSections.All);
FileAttributes fileAttributes = File.GetAttributes(filenameSource);
File.SetAccessControl(filenameDest, fileSecurity);
File.SetAttributes(filenameDest, fileAttributes);
Is this really all I ought to do or am I missing something important?