RFID.RFIDInterface.LakeChabotReader.WaitForFileReady C# (CSharp) Method

WaitForFileReady() private static method

private static WaitForFileReady ( string newFilePath ) : void
newFilePath string
return void
        private static void WaitForFileReady( string newFilePath )
        {
            bool goodOpen = false;
            int totalTries = 100;
            while ( !goodOpen )
            {
                try
                {
                    FileStream s = File.OpenRead( newFilePath );
                    goodOpen = s.Length > 0;
                    s.Close( );
                    s.Dispose( );
                }
                catch ( Exception )
                {
                    if ( totalTries-- == 0 )
                        throw;
                    Thread.Sleep( 50 );
                }
            }
        }