<p>Here is the scenario:</p>

<p>I'm writing an app that will watch for any changes in a specific directory. This directory will be flooded with thousands of files a minute each with an "almost" unique GUID. The file format is this:</p>

<p>GUID.dat where GUID == xxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
(the internal contents aren't relevant, but it's just text data)</p>

<p>My app will be a form that has one single text box that shows all the files that are being added and deleted in real time. Every time a new file comes in I have to update the textbox with this file, BUT I must first make sure that this semi-unique GUID is really unique, if it is, update the textbox with this new file.</p>

<p>When a file is removed from that directory, make sure it exists, then delete it, update textbox accordingly.</p>

<p>The problem is that I've been using the .NET filewatcher and it seems that there is an internal buffer that gets blown up every time the (buffersize + 1)-th file comes in. I also tried to keep an internal List in my app, and just add every single file that comes in, but do the unique-GUID check later, but no dice.</p>

[{'answer_id': 28955, 'author': 'Rob Cooper', 'author_id': 832, 'author_profile': 'https://Stackoverflow.com/users/832', 'pm_score': 3, 'selected': True, 'text': '<p>A couple of things that I have in my head:</p>\n\n<ul>\n<li>If the guid is <em>not</em> unique, would it not overwrite the file with the same name, or is the check based on a lookup which does some external action (e.g. check the archive)? (i.e. is this a YAGNI moment?)</li>\n<li>I\'ve used FileSystemWatcher before with pretty good success, can you give us some ideas as to <em>how</em> your actually doing things?</li>\n<li>When you say "no dice" when working with your custom list, what was the problem? And how were you checking for file system changes without FileSystemWatcher?!</li>\n</ul>\n\n<p>Sorry no answer as yet, just would like to know more about the problem :)</p>\n'}, {'answer_id': 28969, 'author': 'JosephStyons', 'author_id': 672, 'author_profile': 'https://Stackoverflow.com/users/672', 'pm_score': 2, 'selected': False, 'text': '<p>I suggest you take a look at the <a href="http://msdn.microsoft.com/en-us/library/bb762118(VS.85).aspx" rel="nofollow noreferrer">SHChangeNotify</a> API call, which can notify you of all kinds of shell events.  To monitor file creation and deletion activity, you may want to pay special attention to the SHCNE_CREATE and SHCNE_DELETE arguments.</p>\n'}]
['https://Stackoverflow.com/questions/28941', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/750/']