473,809 Members | 2,728 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File Watcher + Win Service

Hi all.
I'm developing a Windows Explorer like app.

I have my own repository to store the files and a bd where i keep the path
to each file.

I have to watch the repository all time to avoid modifications by other
people. So that, i'm using a win service in wich i implement a file watcher.

I have two basic questions:

1) I'm implementig methods to restore the information in the bd if someome
delete, rename or move a file in my repository. The problem i have is that
the file watcher
throws more than one event for example if someone moves a file. So, how can
i know which other events are waiting in the queue (and eventually how can i
acces and navigate to this queue) or is there another way to restore the
changes made to any file on my repository ??

2) My app also can modify the files in the repository, so, i don't want in
these case the file watcher perform the restore actions !! how can i differ
the changes made by my app or somebody else ?? is there any way to ask if my
app is running or something like that ??

Any suggestions are welcome !!

regards !!

Marcelo López
Inforcorp. Uruguay. Latin America.
Jul 21 '05 #1
2 1779
try http://www.knowdotnet.com/articles/fwrecovery.html
"Marcelo López" <t-********@infoco rp.com.uy> wrote in message
news:ev******** ******@TK2MSFTN GP09.phx.gbl...
Hi all.
I'm developing a Windows Explorer like app.

I have my own repository to store the files and a bd where i keep the path
to each file.

I have to watch the repository all time to avoid modifications by other
people. So that, i'm using a win service in wich i implement a file watcher.
I have two basic questions:

1) I'm implementig methods to restore the information in the bd if someome
delete, rename or move a file in my repository. The problem i have is that
the file watcher
throws more than one event for example if someone moves a file. So, how can i know which other events are waiting in the queue (and eventually how can i acces and navigate to this queue) or is there another way to restore the
changes made to any file on my repository ??

2) My app also can modify the files in the repository, so, i don't want in
these case the file watcher perform the restore actions !! how can i differ the changes made by my app or somebody else ?? is there any way to ask if my app is running or something like that ??

Any suggestions are welcome !!

regards !!

Marcelo López
Inforcorp. Uruguay. Latin America.

Jul 21 '05 #2
Thanks. It is interesting but itsn't what i'm looking for.
Like most of examples i have found about file watchers, this one only logs
information on every event that the file watcher raise the event.
I need the way to track events by group, to restore in a consistent way the
information in my bd. For example, if somebody moves a file from one dir to
another, the file watcher raises 4 events, and i can't solve them
separatily. I have to know which other events are next to the one i'm
analizing everytime,

Marcelo
"William Ryan" <do********@com cast.nospam.net > wrote in message
news:uH******** ******@TK2MSFTN GP10.phx.gbl...
try http://www.knowdotnet.com/articles/fwrecovery.html
"Marcelo López" <t-********@infoco rp.com.uy> wrote in message
news:ev******** ******@TK2MSFTN GP09.phx.gbl...
Hi all.
I'm developing a Windows Explorer like app.

I have my own repository to store the files and a bd where i keep the path to each file.

I have to watch the repository all time to avoid modifications by other
people. So that, i'm using a win service in wich i implement a file watcher.

I have two basic questions:

1) I'm implementig methods to restore the information in the bd if someome delete, rename or move a file in my repository. The problem i have is that the file watcher
throws more than one event for example if someone moves a file. So, how

can
i know which other events are waiting in the queue (and eventually how can i
acces and navigate to this queue) or is there another way to restore the
changes made to any file on my repository ??

2) My app also can modify the files in the repository, so, i don't want
in these case the file watcher perform the restore actions !! how can i

differ
the changes made by my app or somebody else ?? is there any way to ask

if my
app is running or something like that ??

Any suggestions are welcome !!

regards !!

Marcelo López
Inforcorp. Uruguay. Latin America.


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
4146
by: Ron Vecchi | last post by:
Hi all, Can someone point me in the direction on this one, resources or examples. I am writing a Windows Service to monitor a folder. When I file is modified within the folder or any subfolders it should write the name of the file to a xml file. Then at a specifed time all the files in the xml quene will be backed up on a network share. How would I go about monitoring a folder and all subfolders and detect when
4
1445
by: Marcelo López | last post by:
Hi all. I'm developing a Windows Explorer like app. I have my own repository to store the files and a bd where i keep the path to each file. I have to watch the repository all time to avoid modifications by other people. So that, i'm using a win service in wich i implement a file watcher. I have two basic questions:
2
3312
by: Jack David | last post by:
Using the code below I am able to monitor a single directory for a new file and then kick-off a process to deal with the file. The question is??? How would I modify this code to be able to monitor a couple of different directories and based upon the directory where the new file is created kick-off a process Example: File A in Directory B starts process C
1
3472
by: Stuart Ferguson | last post by:
I am currently writing a Windows service which monitors multiple folders and processes the files in them accordingly. The folders to be monitored are stored in a string array. I can think of 2 ways of determining which folder has had the file dropped into it and was wondering if there was a better way. The 2 solutions i have are as follows. 1) When the file is picked up by the OnChanged event search the array to determine the file...
2
267
by: Marcelo López | last post by:
Hi all. I'm developing a Windows Explorer like app. I have my own repository to store the files and a bd where i keep the path to each file. I have to watch the repository all time to avoid modifications by other people. So that, i'm using a win service in wich i implement a file watcher. I have two basic questions:
2
2813
by: Guy_B | last post by:
Hi I am using the filesystem watcher to pick up files as they are dropped into a folder - the files are output file from another system and I have no control over that. When 'watcher raises the event that a new file has appeared then sometimes I can read the file even tho it is still being written but it is incomplete. Other time a file access error occurs. I need to write a test that will see if any other process is still using the...
2
2803
by: TwistedPair | last post by:
All, This is sort of a continuation of a previous post of mine. The code below basically reads a registry key to get a path to a folder and it watches for files created in that folder (only created). It also reads another registry key for another path which is a destination path. When a file shows up, it copies it off. It actually works well . . . For small duty stuff but if for example I were to copy in multiple small files...
1
2679
by: =?Utf-8?B?QXZp?= | last post by:
Hi I have an interesting issue, I hope someone can shead light on: I have a 2 server "web farm" with a web app that produces image files. To ensure synchronization of content on both machines, we have built a vb.net (2.0) file watcher service to keep the web folders synchronized between the 2 machines. the app uses in-proc session variables for some other stuff. We have run into a strange problem: when the file watcher service is
6
1696
by: Andy B | last post by:
What would i use to look for changes in a file every minute?
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9199
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7660
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3014
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.