Solved

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

Posted on 2010-08-24
1
273 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

632 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