Filename Created Error Modified File1.TXT 1:45:05 1:45:23 1:45:35 File2.TXT 1:44:46 1:45:23 1:45:58 File3.TXT 1:45:18 1:45:23 1:45:27 File4.TXT 1:45:20 1:45:23 1:45:27I'm wondering if the code like this (right now is using some hard-coded numbers, but I'm changing it to database settings as well) going to be sufficient to fix the problem:
internal bool FileIsReadyToProcess(string fullPathFileName) { int waitForFileToCopy = 500; // wait 0.5 second int iCount = 0; bool isValid = false; do { isValid = File.Exists(fullPathFileName); if (!isValid) Thread.Sleep(waitForFileToCopy); } while (!isValid && iCount++ < 10); return isValid; }