FileMonitor/ FileFilter to watch for a specific pattern in filename?

  • Thread starter Thread starter Shikari Shambu
  • Start date Start date
S

Shikari Shambu

I have a need to look for existence of a file in a directory and process it
as soon as it is found. The file itself has the date of generation in its
name and only file with today's date should be processed.

Is there a way to specify a pattern in the FileFilter. Or, do I have to have
additional code to check if the name matches the pattern?

TIA
 
Shikari Shambu said:
I have a need to look for existence of a file in a directory and process it
as soon as it is found. The file itself has the date of generation in its
name and only file with today's date should be processed.

Is there a way to specify a pattern in the FileFilter. Or, do I have to have
additional code to check if the name matches the pattern?

TIA

Do you mean FileSystemWatcher? If so, then yes, you can set the Filter
property. See
http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.filter.aspx.
 
I have a need to look for existence of a file in a directory and process it
as soon as it is found. The file itself has the date of generation in its
name and only file with today's date should be processed.

Is there a way to specify a pattern in the FileFilter. Or, do I have to have
additional code to check if the name matches the pattern?

TIA

Hi,

You ahve to set the Filter to the common part, then in your handler
you will have to deal with the date interpretation
 
Back
Top