Solved

Trouble with filesystemwatcher

Posted on 2014-01-16
2
195 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
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:…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now