?
Solved

Trouble with filesystemwatcher

Posted on 2014-01-16
2
Medium Priority
?
211 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 1000 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

Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

Question has a verified solution.

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

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…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

764 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