ignore files in flight
<p>When I run the code below, it fills my array with a list of files in the specified directory. </p>

<p>This is good. </p>

<p>However, it also grabs files that are 'in flight' - meaning files that are currently being copied to that directory. </p>

<p>This is bad.</p>

<p>How do I go about ignoring those 'in-flight' files? Is there a way to check each file to make sure it's 'fully there' before I process it? </p>

<pre><code>string[] files = Directory.GetFiles(ConfigurationSettings.AppSettings.Get("sourcePath"));
        if (files.Length &gt; 0)
        {

            foreach (string filename in files)
            {
                string filenameonly = Path.GetFileName(filename);
                AMPFileEntity afe = new AMPFileEntity(filenameonly);
                afe.processFile();
            }

        }
</code></pre>
