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

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
 
F

Family Tree Mike

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

Ignacio Machin ( .NET/ C# MVP )

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top