filesystemwatcher

FileSystemWatcher locks folder

十年热恋 提交于 2019-12-07 05:54:16
问题 I have a FileSystemWatcher listening on a folder. When I try renaming this folder (in Windows Explorer) I get a The action can't be completed because the folder or a file in it is open in another program error. Commenting out the FileSystemWatcher calls fixes this. I've tried reproducing the error with a simple program, but haven't been successful so I'm not sure what's going on here. Has anyone encountered anything like this with a FileSystemWatcher ? If so - what might be causing it? More

Additional parameters for FileSystemEventHandler

眉间皱痕 提交于 2019-12-07 01:34:17
问题 I'm trying to write a program that could monitor multiple folders for file creations and launch the same action but with different settings for each folder. My problem is in specifying an extra parameter for the FileSystemEventHandler. I create a new FileWatcher for each directory to monitor and add the handler for the Created-action: foreach (String config in configs) { ... FileWatcher.Created += new System.IO.FileSystemEventHandler(FileSystemWatcherCreated) ... } void

File Watcher - get the process name that created a file in Windows?

你说的曾经没有我的故事 提交于 2019-12-06 15:59:59
问题 Is there a good way to get the process name that created a file in Windows? I have a directory on a Windows 2000 Server C:\WINNT\Temp that is filling up with files named like: 70618199 21834082 They are always 121,201 KB in size. Programatically can I "capture" the program name or service name that is dropping files in this location? MORE INFO: I did some more research on this. I renamed the file TIFF and was able to open it. This machine functions as a document search tool via a custom

Cross platform C++ filesystem watcher

人盡茶涼 提交于 2019-12-06 12:12:47
I'm looking for a cross platform file system watcher, similar to the FileSystemWatcher class in .NET. As it's for a daemon/service, I'm not keen on Qt's QFileSystemWatcher . I'd really like to avoid it as I don't want to have a dependency on Qt as my program is going to be a daemon. I've also seen a proposal for such a class to be included in Boost, but as far as I know such a class has not yet been included. Is there a cross platform C++ file system watcher? Qt is divided into modules , so using this feature doesn't mean you have to use the GUI library. QFileSystemWatcher is in QtCore , which

FileSystemWatcher InternalBufferOverflow

我是研究僧i 提交于 2019-12-06 11:51:24
I am getting an exception System.IO.Internal.BufferOverflowException when I am trying to monitor a folder on network path(DFS - Distributed File System): To many changes at once . It works fine when FileSystemWatcher is monitoring local/network path that don't use this filesystem. I am able to get an event from 1000 + files on local path and I am not getting BufferOverflow exception, however when I am copying file to folder that is on DFS I am not even able to get an event from one(To clarify this, I am getting an error event raised...). I've already tried to set: fileSystemWatcher

Filesystemwatcher double entries

喜你入骨 提交于 2019-12-06 09:45:02
问题 I made a small winforms application to monitor a certain folder for new pdf files, if a new pdf file is created in the particulair folder it will copy it to an other location. The problem i'm having is that the filesystemwatcher creates double/multiple entries in my listbox, how can i solve this? namespace Scanmonitor { public partial class Form1 : Form { FileSystemWatcher watcher = new FileSystemWatcher(); DateTime lastRead = DateTime.MinValue; public Form1() { InitializeComponent(); }

Why does FileSystemWatcher create multiple change events when I copy a file to the directory

两盒软妹~` 提交于 2019-12-06 05:04:39
问题 I've written a small test application using the .Net FileSystemWatcher to keep an eye on a directory. When I copy a large-ish (a few Mb) file into that directory I get the following events listed (see screenshot - and ignore the Delete event to begin with). alt text http://robinwilson.homelinux.com/FSW.png I get a created event (as expected), but then two changed events (about 0.7 seconds apart). Why is this? This would cause major problems in the application I am planning to develop - as I'd

How to check in Node.js if a file is open/being written to?

喜欢而已 提交于 2019-12-06 04:43:31
问题 I found many answers for C++, C#, etc. but haven't yet found one for Node.js. Here is my case. I've created a module which watches for file/directory changes (new or updated, doesn't care about deleted files) in my FTP server. Once I notice a new file, or an existing one is changed, I get a notification and notify my module B to sync this file to Sourceforge.net. The module works fine, reacts to changes instantly. But what I'm not satisfied with yet is that when a new file is added, that file

FileSystemWatcher under mono - watching subdirs

半城伤御伤魂 提交于 2019-12-06 04:39:09
问题 I have a problem. I have written a wrapper over FileSystemWatcher that detects changes in root folder and all of its subfolders. Nothing fancy: FileSystemWatcher watcher = new FileSystemWatcher (); watcher.Path = this.Root; watcher.IncludeSubdirectories = true; watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.LastAccess | NotifyFilters.DirectoryName | NotifyFilters.FileName; watcher.Changed += new FileSystemEventHandler (watcher_Changed); watcher.Deleted += new

Equivalent of FileSystemWatcher (.NET) in Cocoa

无人久伴 提交于 2019-12-06 02:03:24
问题 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 solution 回答1: Please have a look at FSEvents. 回答2: As Diederik says, FSEvents is Apple's Carbon API for listening to file system events. Someone has created a Cocoa/Objective-C wrapper for FSEvents called SCEvents that is a little easier to use. 回答3: Another option would be to drink directly from