filesystemwatcher

WPF - Cannot change a GUI property inside the OnChanged method (fired from FileSystemWatcher)

血红的双手。 提交于 2019-12-18 08:39:19
问题 I want to change a GUI property in the OnChanged method... (in actuality im trying to set an image source.. but used a button here for simplicity). This is called everytime filesystemwatcher detects a change in a file.. and it gets to the "top" output.. but catches an exception when it tries to set the button width. but if i put the same code in a button.. it works just fine. I sincerely don't understand why.. can someone help me? private void OnChanged(object source, FileSystemEventArgs e) {

FileSystemWatcher not raising when files are copied or moved to folder [duplicate]

一世执手 提交于 2019-12-18 07:08:23
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Detecting moved files using FileSystemWatcher I was looking for a solution to watch a directory and notify my app whenever a new file is moved into the directory. The Obvious solution was to use FileSystemWatcher class of the .NET. But the problem is , it raises a event a new file is created/deleted in the folder but does not raises event when a file is moved/copied into the folder. Can anyone tell me what could

FileSystemWatcher skips some events

亡梦爱人 提交于 2019-12-17 19:46:14
问题 If you google for FileSystemWatcher issues, you will find a lot of articles about FileSystemWatcher skipping some events (not firing all events). Basically, if you change a lot of files in watched folder some of them will not be processes by FileSystemWatcher . Why is that so, and how can I avoid missing events? 回答1: Cause FileSystemWatcher is watching for changes happening in some folder. When file is changed (e.g. file is created), the FileSystemWatcher raises the appropriate event. The

.NET filesystemwatcher - was it a file or a directory?

倾然丶 夕夏残阳落幕 提交于 2019-12-17 18:25:29
问题 Is there a way to determine with the FSW if a file or a directory has been deleted? 回答1: Here's a simplified and corrected version of fletcher's solution: namespace Watcher { class Program { private const string Directory = @"C:\Temp"; private static FileSystemWatcher _fileWatcher; private static FileSystemWatcher _dirWatcher; static void Main(string[] args) { _fileWatcher = new FileSystemWatcher(Directory); _fileWatcher.IncludeSubdirectories = true; _fileWatcher.NotifyFilter = NotifyFilters

How to watch a directory for changes? [duplicate]

妖精的绣舞 提交于 2019-12-17 16:33:46
问题 This question already has answers here : Monitoring contents of files/directories? [duplicate] (5 answers) Closed 6 years ago . Could not find anything in python core to do this. Can anyone recommend a library or "battery" to do this? Ideally I would like this to be portable but it's OK if it is available only for Unix (my server). 回答1: On Linux, you could be interested in pyinotify https://github.com/seb-m/pyinotify Other related libraries: http://people.gnome.org/~veillard/gamin/python.html

FileSystemWatcher not firing events when file written using fprintf or printf

早过忘川 提交于 2019-12-14 02:58:43
问题 Yes there are many similar questions but none of them address my unique situation. There is a separate c++ process writing the file using c++ printf and fprintf. filename i am trying to watch is info_20160525.log My fileSystemWatcher in winform C# application gets notification when the writer process writes to the file AND I physically access the file i-e F5 the folder or have it open in textpad and click the opened file or right click the file but I never get any event notification when I

Get notified about the change in raw data in hard disk sector - File change notification

江枫思渺然 提交于 2019-12-13 19:53:58
问题 I'm trying to make a software that backups my entire hard drive. I've managed to write a code for reading the raw data from hard disk sectors. However, i want to have incremental backups. For that i need to know the changed made to OS settings, file changes, everything. My question is - Using FileSystemWatcher and Inotify, will i be able to know every change made to every sector in the hard drive ? (OS settings etc) I'm coding it in C++ for linux and windows. (Saw this question on

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

好久不见. 提交于 2019-12-13 16:20:07
问题 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 local directory where the process then encodes the file to several different formats and spits them out to an output directory. The problem arises because the video files are so big, that it often takes several minutes for them to copy completely into the network directory, so when a file is

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

有些话、适合烂在心里 提交于 2019-12-13 14:16:53
问题 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 method looks like this : void watcher_FileCreated(object sender, FileSystemEventArgs e) { FileInfo f1 = new FileInfo(e.FullPath); filesDataGrid.Rows.Add(f1.Name); foreach (TLPclass table in parameterForm.getParameters) { //uses some funcion form another class } } Line which causes program to close

C# FileSystemWatcher lock folder

走远了吗. 提交于 2019-12-13 06:42:59
问题 I'm trying to monitor a folder using C# and FileSystemWatcher. everything works well, except the fact that i can delete the folder i'm actually watching I used to do this in C using ReadDirectoryChangesW, by creating a handle to the folder, and locking it, which prevented delete or rename from the user to that folder (i'm talking about the actual monitored folder, not it's contents) Is there any way to lock that folder so people don't delete it while it's being watched? (note that I don't