This project is read-only.

NTFS.File.Delete Exception

Jul 22, 2011 at 10:01 AM

Hi Ken,

I seem to have found in problem with Ntfs.File.Delete.

Sometimes it throws the exception: Collection was modified; enumeration operation may not execute

I don't know why it happens on some windows servers and not others.

I have traced it down to this:


            foreach (var attr in _attributes)





I have replaced with:


            for (int i = _attributes.Count - 1; i >= 0; i--)


                NtfsAttribute attr = (NtfsAttribute)_attributes[i];




is this ok?



Jul 24, 2011 at 9:06 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.