Directory.Move

G

Guest

Hi,
Someone knows what happens in detail if Directory.Moves (.NET C# 2.0) throws
an exception?
Background:
I'm stepping through all subdirectories within some directory (e.g. c:\test)
and moveing all those directories to another location.
If moveing ONE subdirectory fails I'm trying to move back all previous
correctly
moved directories ... so far so good ...
But what happen with the last directory which movement caused the exception.
Does this directory keeps its "original" state, or are just some files
moved, ...

Thanks in advance for an answer
and regards,
Martin
 
D

Dave Sexton

Hi Martin,

I know this doesn't directly answer your question, but why not just copy the directories and then delete the source if they all copy
successfully?
 
G

Guest

Hi Dave,

yes, that was the alternative, but what I wanted to figure out (additionally),
is that several detail information is missing within the documentation.
In my opionen developers need a lot of more infos.

If there will be no answers according to my question I have to
change implementation to your suggestion.

Thanks and best regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top