The time of single-targeted single-user OS was gone, at least PC. It could be allowed not to verify the rights to the files and not to be afraid. That after being checked, the file would not be read. But there were issues that needed to be addressed, such as reading errors at the hardware level.File system is unstable. Anything can happen, disconnect power, until the right changes to the wrong admin right during your program. And that needs to be taken into account.Copying the tree of the folder, as the basic algorithm, is not difficult, classic recurring to the depth or breadth, to the author ' s discretion. There are several questions on the question and the next answer. But in a multi-use multi-target environment, it will have to take into account the characteristics of this environment at every stage of the algorithm.1. Mandatory processing of exceptions.File operations can generate (and generate) a mass of different exceptions (i.e.) https://msdn.microsoft.com/ru-ru/library/b9skfh7s(v=vs.110).aspx#%D0%98%D1%81%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D1%8F File.Open) Good, every type of exception needs to be processed in a separate unit. catchwhy see below.2. Coping folder integrated and long-termFor us, this means that before the algorithm is implemented, several questions need to be answered and, on the basis of answers to these questions, the processing of exceptions. Example list of issues:The exception was to ignore, interrupt the operation, ask the user?As stated above, exemptions are different, therefore how do we respond to specific types of exemptions?What do we do with the previously processed objects of the interrupted operation: remove, leave what?If you remove it, how do you feel about being replaced? Yeah, yeah, there's got to be a bacap or a shadow copy, or a CVS, or something else you can think of, and if they're not?And I have not yet mentioned the possible disconnection of the host by an unconventional user during copying, hit clusters, electric rodent, neighbour of a welder, weather at Venus, and a lot of things that might somehow trigger an exception.3. No silver bullet.All listed and non-listed questions will have to be answered in any transactions with files, in some cases simple answers are not available. There's no universal solution. Somewhere needs reliability, some integrity of the data, some speed, and there's a lack of annoying questions for the user. Targets are different, decisions are different. The general recommendation may be as follows: Don't be afraid of any exceptions to the file system, they are, and they need to be used correctly. For maniacs of greed up to speed and productivity, the operation of the file system facilities at any of the modern launchers, including RAM discs, is carried out slower than the generation and processing of exemptions. Don't save the matches.Forget it. File.Exists, he's not an assistant in the modern environment, if of course your purpose is something other than the very verification of the existence of a file/padka.Turn around. try catch finaly All operations with the files.Provide for an correct completion of the operation interrupted, if possible.If the programme ' s logic allows, inform the user of the problems immediately, not necessarily obscure, it can be simply concluded in a consensor or log if the user does not need a solution, or more insistently, if he does not intervene actively.If the operation can damage the data (recording, removal, etc.) please ask the user for his confidence. Users will be mothers (I will, too, yes but you and the user will have at least a little confidence that he did this, not his cat or his 3-year-old child.