Solved

File move blowing up because the parent directory sometime does not get cleaned.

Posted on 2010-08-24
1
272 Views
Last Modified: 2013-12-17
I need to know how make the following statement not blow up and go into the exception handler, when the file is stuck in the parent directory.

 File.Move(Path.Combine(targetDir, xmlFileName), Path.Combine(targetDir, xmlNewName));

What happens is the vendor is leaving the some of the files in the directory and on my Catch statement if the name is still there this blows up.

Since this program runs every five minutes I don't want to fill the event log with error messages.

How do I return the program without it blowing up?
0
Comment
Question by:kimmie8000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
kimmie8000 earned 0 total points
ID: 33513109
if (File.Exists(path))
           
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question