473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Directory.Move

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
Oct 3 '06 #1
3 1465
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?

--
Dave Sexton

"Martin" <Ma****@discussions.microsoft.comwrote in message news:2C**********************************@microsof t.com...
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

Oct 5 '06 #2
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

"Dave Sexton" wrote:
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?

--
Dave Sexton

"Martin" <Ma****@discussions.microsoft.comwrote in message news:2C**********************************@microsof t.com...
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


Oct 5 '06 #3
Hi Martin,

You could look at the source code if you want to.

Lutz Roeder's .NET Reflector (top of list):
http://www.aisto.com/roeder/dotnet/

Microsoft's Shared Source CLI on MSDN:
http://msdn.microsoft.com/library/de...rsourcecli.asp

--
Dave Sexton

"Martin" <Ma****@discussions.microsoft.comwrote in message news:24**********************************@microsof t.com...
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

"Dave Sexton" wrote:
>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?

--
Dave Sexton

"Martin" <Ma****@discussions.microsoft.comwrote in message news:2C**********************************@microsof t.com...
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



Oct 5 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Chad | last post by:
I am receiving the following two errors in the code below. Both are on Line 56. error C2039: 'CreateDirectoryA' : is not a member of 'System::IO::Directory' error C2660: 'CreateDirectoryA' :...
6
by: Hemant Shah | last post by:
Folks, I need to move HOME directory of an instance to another directory. What is the best way of doing it? Is changing password file enough? or dies DB2 store this info in it's own config? ...
3
by: andrew | last post by:
I do not understand how this function should work. It seems to be different than when I drag a folder ... error message: Cannot create a file when that file already exists. c:\atest has...
2
by: ngposter | last post by:
Try the following code snippet: Directory.CreateDirectory(@"C:\Folder1\"); Directory.Move(@"C:\Folder1\", @"C:\Folder2\"); Directory.Delete(@"C:\Folder2\"); After executing, a C:\Folder1...
1
by: rv | last post by:
I am developing an ASP.NET website with C#, VS 2003 and Framework 1.1. For some reason every time I execute a Directory.Move command, the next command takes 10-20 seconds to execute. Has anyone...
1
by: jojobar | last post by:
I have noticed that the Directory.Move removes the session as soon as the next Response.Redirect is done. It also appears that .Net framework constantly monitors all the directories below the root...
3
by: Karel | last post by:
Hello, I have a VB.NET application where I want to move directories over a network. I tried this with system.io.directory.move, but that doesn't work over different volumes. Has anyone a...
3
by: Daves | last post by:
why the heck can't I use Directory.Move() to rename a directory (containing files) to a entry 2 levels below e.g. uploads/tempfiles -> uploads/tempfiles/48/003files if I do this in one line...
4
by: Janiek Buysrogge | last post by:
Hello, Maybe this has been covered in the past in this group, but I wasn't able to find any references. If it has been covered, please provide me with a link of some sort. I'm trying to...
0
by: Matt MacDonald | last post by:
Hi all, I'm having a really frustrating problem. I have a web application that needs to modify the directory structure of the underlying files. The problem I'm having is that after the system...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.