--- dao/file2mq/file2mq/Program.cs 2013/07/03 07:51:12 1984 +++ dao/file2mq/file2mq/Program.cs 2015/06/11 13:41:56 2576 @@ -73,6 +73,15 @@ Environment.Exit(1); } + String baseName = Path.GetFileName(fileName); + String archiveFile = archiveDir + "\\" + baseName; + + if (File.Exists(archiveFile)) + { + Console.WriteLine("Archive file already exists {0}", archiveFile); + Environment.Exit(1); + } + StreamReader input = null; try @@ -135,8 +144,8 @@ input.Close(); - String baseName = Path.GetFileName(fileName); - Directory.Move(fileName, archiveDir + "\\" + baseName); + + Directory.Move(fileName, archiveFile); } //If an error has occurred in the above,try to identify what went wrong.