Solved

Trouble with filesystemwatcher

Posted on 2014-01-16
2
198 Views
Last Modified: 2014-01-16
I'm creating a filewatcher, and even though I set the filter to a specific file extension, the rename event is triggered when the file is changed 'from' that extension that I'm looking for.

Do I have to capture this in my rename event too?

Example:
I'm watching for .filter "*.ABC"

If I rename file.ABC to file.DEF, the rename event is fired.
I only want to process the file if a file is renamed 'to' *.ABC

I know it's possible to simply check that file extension in the rename event, but I wasn't sure if I was overlooking some other setting...
0
Comment
Question by:sirbounty
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
ID: 39786124
Sorry for you, but the FileSystemWatcher does not have an option for ExtensionChanged.

What you could do, if you are at ease with the concept, is to build a class that inherits from FileSystemWatcher and code it to add the necessary option.
0
 
LVL 67

Author Comment

by:sirbounty
ID: 39786158
I'll just create a fileinfo reference and check the extension that way then...
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question