Tagged Questions

C# class that listens to the file system change notifications and raises events when a directory, or file in a directory, changes.

learn more… | top users | synonyms

58
votes
9answers
17k views

FileSystemWatcher vs polling to watch for file changes

I need to setup an application that watches for files being created in a folder (locally or on a network drive) and I was wondering if anyone has any thoughts on whether the FileSystemWatcher or ...
64
votes
12answers
17k views

FileSystemWatcher Changed event is raised twice

I have an application where I am looking for a text file and if there are any changes made to the file I am using the OnChanged eventhandler to handle the event. I am using the ...
7
votes
5answers
3k views

Detecting moved files using FileSystemWatcher

I realise that FileSystemWatcher does not provide a Move event, instead it will generate a separate Delete and Create events for the same file. (The FilesystemWatcher is watching both the source and ...
15
votes
8answers
13k views

File access error with FileSystemWatcher when multiple files are added to a directory

I am running into an issue with a FileSystemWatcher when multiple files are placed into the watched directory. I want to parse the file as soon as it is placed in the directory. Typically, the first ...
1
vote
6answers
6k views

FileSystemWatcher Fails to access network drive

I am trying to run a file watcher over some server path using windows service. I am using my windows login credential to run the service, and am able to access this "someServerPath" from my login. ...
7
votes
3answers
6k views

Notification when a file changes?

Is there some mechanism by which I can be notified (in C#) when a file is modified on the disc?
6
votes
4answers
2k views

Does anyone have a FileSystemWatcher-like class in C++/WinAPI?

I need a .Net's FileSystemWatcher analog in raw C++/WinAPI. I almost started to code one myself using FindFirstChangeNotification/FindNextChangeNotification, but then it occurred to me that I am ...
7
votes
14answers
11k views

VB.NET FileSystemWatcher Multiple Change Events

I have the following code: Imports System.IO Public Class Blah Public Sub New() InitializeComponent() Dim watcher As New FileSystemWatcher("C:\") ...
7
votes
3answers
2k views

FileSystemWatcher and windows 7

I am writing a tool that monitors a network directory and is running off of a Windows Server 2008 machine, the OnChanged event for the FileSystemWatcher is being fired correctly from files placed on ...
1
vote
2answers
435 views

configuring filesystemwatcher such that it raises created event only when the file is fully copied

FileSystemWatcher is a very faulty class i think. When there is a big file moved into the watched folder,it raises creted event even before the file is copied fully. Copying such files within the ...
1
vote
1answer
578 views

FileSystemWatcher stops raising events after a period of time

We have built a window service that listens to folders with FileSystemWatcher, when created we process the file and so on. But after couple of days the event stops working. Is it possible that it ...
5
votes
1answer
8k views

How do you monitor file access and changes on a file server by user name?

I was asked to find a way to monitor changes (modification, renaming, deletion, moving) of files in specific folders on the company's shared file server (simple windows shared directory). I wrote a ...
3
votes
2answers
2k views

Using FileSystemWatcher with multiple files

I want to use FileSystemWatcher to monitor a directory and its subdirectories for files that are moved. And then I want to trigger some code when all the files have been moved. But I don't know how. ...
6
votes
2answers
2k views

FileSystemWatcher stops catching events

I am writing a c# program to let me know when a file has been added or deleted. I run it on my Windows 7 machine and watch an FTP server on our network. It works fine but will suddenly stop ...
5
votes
4answers
614 views

monitor file/directory access in C#

I want to develop the application which logs the files / directories accessed on the machine. e.g. I go to D:\ and into a folder documents and open a word file. I want my application to create a log ...
5
votes
3answers
605 views

C# - Predict file system events on folder delete

This is more a question about what's the best practice in implementing this. I have a FileSystemWatcher which should inform me about User's changes on files and folders. Also subdirs are watched. In ...
4
votes
3answers
2k views

How does FileSystemWatcher work on another computers directory?

Something intrigues me and I don't find any resource on this. How can FileSystemWatcher know when a file on a computer "A" is created/removed/changed/renamed ? I thought that this worked with ...
2
votes
3answers
609 views

FileSystemWatcher Work is Done?

I setup a FsWatcher on a local filesystem directory. I only want to know when files are added to the directory so they can be moved to another filesystem. I seem to be able to detect when the first ...
-1
votes
1answer
568 views

Get Username of an Accesed File

I would like to get the username of an accessed file (add, delete, rename,...). actually I use filesystemwatcher to monitor the file access and I have activated object access on an directory to get ...
17
votes
7answers
11k views

System.IO.FileSystemWatcher to monitor a network-server folder - Performance considerations

I want to watch a folder tree on a network server for changes. The files all have a specific extension. There are about 200 folders in the tree and about 1200 files with the extension I am watching. ...
5
votes
4answers
2k views

C#: Monitoring copied or moved files with FileSystemWatcher

I have come across several "solutions" here and across the web but none seem to fit the bill. What I am looking to do is have an app monitor a folder for new files (either by creation, a move, or a ...
7
votes
2answers
6k views

Node.JS: How does “fs.watchFile” work?

According to the API docs for Node 0.4.3, the fs.watchFile(filename, [options], listener) function starts a routine that will Watch for changes on filename. The callback listener will be called ...
9
votes
3answers
878 views

BackgroundWorker & Timer, reading only new lines of a log file?

My application writes a log file (currently using log4net). I'd like to setup a timer and a background worker to read the log file and print its content into some control in my form, while it's being ...
3
votes
5answers
2k views

Filesystem watcher and large files

var fsw = new FileSystemWatcher(sPath, "*.PPF"); fsw.NotifyFilter = NotifyFilters.FileName; fsw.IncludeSubdirectories = true; fsw.Created += FswCreated; fsw.EnableRaisingEvents = true; static void ...
3
votes
5answers
2k views

Handling multiple Change Events in FileSystemWatcher

I have the following sub: Private Sub Watcher_Changed(ByVal sender As System.Object, ByVal e As FileSystemEventArgs) If Path.GetExtension(e.Name) = ".p2p" Then Exit Sub ...
5
votes
1answer
401 views

Notification callback in iOS when iTunes sync/file transfer is complete

I have searched for how to receive callbacks in iOS5 when the file system has changed. I've found the following sample from Apple's site, but it only notifies the given delegate when a file is ...
5
votes
7answers
2k views

Equivalent of FileSystemWatcher (.NET) in Cocoa

I am developing an application in Cocoa. I want to constantly check whether the contents of a file in a particular location is changed or not (like FileSystemWatcher in .NET). Please anyone give me a ...
10
votes
5answers
5k views

Monitor multiple folders using FileSystemWatcher

Whats the best way to monitor multiple folders (not subdirectories) using FileSystemWatcher in C#?
7
votes
4answers
730 views

Transfer large data between .net applications on same computer

I have two .net applications that run on the same machine. The first application is the 'Engine'. It builds images - image's size is about 4M. The second applications is the 'Viewer'. It shows the ...
7
votes
1answer
800 views

FileSystemWatcher triggers for filestream open

I have a filesystemwatcher that will trigger an event when a file is modified. I want to read from that file once the lock has been removed. At the moment I am just trying to open the file once the ...
3
votes
4answers
2k views

How to force FileSystemWatcher to wait till the file downloaded?

I am downloading a file and want to execute the install only after the download is complete. How do I accomplish this? Seems like FileSystemWatcher onCreate event would do this but this happens in a ...
2
votes
3answers
824 views

How to monitor process' IO activity using C#?

Using FileSystemWatcher we can monitor the IO activity of a particular file system, but is there anyway to know that which one of the running processes is causing that IO? More specifically, suppose ...
1
vote
2answers
730 views

FileSystemWatcher running under impersonated user

I have an c# winform application that runs under a local account but needs to monitor folders on a domain. I am using slightly modified code from here to copy the files and that works fine. Can ...
1
vote
4answers
747 views

How do I know when a file has been modified in a VBA Macro?

Is there a way to watch a file in VBA (which is essentially VB6), so that I know when the file has been modified? -- similar to this only I don't want to know when a file is unused, just when its ...
0
votes
4answers
3k views

FileSystemWatcher.WaitForChanged returns, but there is still a lock on the file

I have a program that send a document to a pdf printer driver and that driver prints to a particular directory. After the print I want to attach the pdf to an e-mail (MailMessage) and send it off. ...
5
votes
6answers
576 views

Detect File Read in C#

I'm using FileSystemWatcher to check when a file is modified or deleted, but I'm wondering if there is any way to check when a file is read by another application. Example: I have the file ...
4
votes
3answers
2k views

After FileSystemWatcher fires - Thread Pool or Dedicated thread?

I am about to implement the archetypal FileSystemWatcher solution. I have a directory to monitor for file creations, and the task of sucking up created files and inserting the into a DB. Roughly ...
3
votes
3answers
362 views

FileSystemWatcher to watch UNC path

There are no shortage of questions on this topic, but I'm still having trouble. Here is my situation. I've got a service that I need to watch a path that is specified in the config file. It works ...
3
votes
2answers
553 views

Application just closes (no error or smth) when run from VS2010

Problem is that application closes without any error, VS stays opened. I have multiple dynamically created FileSystemWatchers, all of them have eventhandler on "Created" event. So this eventhandler ...
3
votes
4answers
1k views

how to watch a File System for change

I'm doing a project in a course at my university on distributed systems. I'm planning on creating something similar to Dropbox ( getdropbox.com ), but with some sort of non-centralized peer-to-peer ...
2
votes
1answer
129 views

Why doesn't OS X lock files like windows does when copying to a Samba share?

I have a project that uses the .net FileSystemWatcher to watch a Samba network share for video files. When it sees a file, it adds it to an encode queue. When files are dequeued, they are moved to a ...
2
votes
2answers
438 views

FileSystemWatcher - minimum permissions needed on target directories?

Using the .NET FileSystemWatcher http://msdn.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx to monitor a directory full of files for : Changed; Created; Deleted; Renamed events . What's ...
2
votes
3answers
1k views

C#: How to check if a open file has been updated

You know the feature for example, you opened C:\test.txt if you also have the same file in another editor, and you edit it there, when you return, the app will prompt that the file has changed, ...
2
votes
8answers
2k views

Reading changes in a file in real-time using .NET

I have a .csv file that is frequently updated (about 20 to 30 times per minute). I want to insert the newly added lines to a database as soon as they are written to the file. The FileSystemWatcher ...
1
vote
1answer
189 views

How to Get the deleted File/Folders using FileSystemWatcher

How to get the complete list of deleted files if user delete the a root folder: Ex: c:\A\B\C\D\F\read.txt If user delete the root folder A, I need to get the files/folders realted to A, Is there any ...
1
vote
2answers
217 views

C# : file copy notifying

hi i am creating a c# application that monitor the files that has been copied , the aim of program is to alert user that there is a file has been copied , i know the file system watcher class , but it ...
1
vote
2answers
1k views

FileSystemWatcher is not working!

I added FileSystemWatcher in Form1_Load like this - Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load .................... Dim ...
1
vote
2answers
1k views

FileSystemWatcher does not work properly when many files are added to the directory at the same time

FileSystemWatcher does not work properly when many files are added to the directory at the same time... The Watcher simply doesn't find all the files in the directory - only if the files are placed ...
1
vote
2answers
966 views

VBA watch file in use

I"m looking for something (Win API calls or whatever) to notify me when a file becomes available for editing (i.e. no longer in use). Should I set up a timer to check the files on some interval or is ...
0
votes
1answer
106 views

Filewatcher in java to watch windows folders and inform linux

I have a use case as per which, my module which is running over Linux file system should be notified of any new file in remote windows share. Is there any built in functionality for this? I have done ...

1 2
15 30 50 per page