filesystemwatcher

Why am I getting a Unhandled Exception: System.IO.IOException when trying to read from a file being written to?

混江龙づ霸主 提交于 2020-01-01 16:48:20
问题 I have two C# applications, one is reading a file (File A) line by line and writing its contents to a different file (File B). The second application is using FileSystemWatcher for File B to see when it is updated and reporting the difference is line numbers between when the program was started and when the file was changed. Thats all I am trying to do for now, ultimately I want to read the lines between when the file was last read and the current read but until I can get the line difference

FileSystemWatcher for FTP

狂风中的少年 提交于 2019-12-31 22:37:48
问题 How can I implement a FileSystemWatcher for an FTP location (in C#). The idea is whenever anything gets added in the FTP location I wish to copy it to my local machine. Any ideas will be helpful. This is a follow up of my previous question Selective FTP download using .NET. 回答1: You're going to have to implement a polling solution, where you keep asking for the directory content periodically. Compare this to a cached list from the previous call and determine what happened that way. There's

Transfer large data between .net applications on same computer

怎甘沉沦 提交于 2019-12-30 01:00:13
问题 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 images which the 'Engine' sends. The engine sends images every 10-15 seconds. My question is what is the bast way to pass the images from the engine to the viewer. Currently, I'm using FileSystem for this. The Engine writes the image to file system folder and the viewer getting this file using

What is the impact of a FileSystemWatcher on a hard drive?

ぃ、小莉子 提交于 2019-12-29 09:02:43
问题 I've used FileSystemWatcher in the past. However, I am hoping someone can explain how it actually is working behind the scenes. I plan to utilize it in an application I am making and it would monitor about 5 drives and maybe 300,000 files. Does the FileSystemWatcher actually do "Checking" on the drive - as in, will it be causing wear/tear on the drive? Also does it impact hard drive ability to "sleep" This is where I do not understand how it works - if it is like scanning the drives on a

Using FileSystemWatcher with multiple files

烂漫一生 提交于 2019-12-29 06:22:58
问题 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. My code as is will trigger each time a file is moved, and if a user moves several files at once I only want it to trigger once for all files. So basically I want to create a list, and once the moving of all files is done I want to do stuff to that list... Here's the code: class Monitor { private

watching a directory in ruby

不羁岁月 提交于 2019-12-29 03:34:53
问题 We have an application that needs to process incoming files that are dropped into a directory. I am looking for the best way to do this. We have been using a looping Backgroundrb process, but, to be honest Backgroundrb is unreliable and we'd like to move away from it if possible. Delayed_job doesn't seem to be for ongoing tasks but for one offs. I've found DirectoryWatcher http://codeforpeople.rubyforge.org/directory_watcher/ which looks promising, but ideally we want to have some control

FileSystemWatcher pitfalls

泄露秘密 提交于 2019-12-28 16:15:10
问题 I am working on a C# program that needs to use the FileSystemWatcher class so it will be notified when new files are created. As part of the initialization, the program scans the directory so it can process any files that already exist in it. This is all working fine. However, in a discussion with another developer, we started questioning whether this will always work. Are there conditions under which the FileSystemWatcher will miss the creation of files? If so, what are these conditions? In

FileSystemWatcher pitfalls

十年热恋 提交于 2019-12-28 16:15:09
问题 I am working on a C# program that needs to use the FileSystemWatcher class so it will be notified when new files are created. As part of the initialization, the program scans the directory so it can process any files that already exist in it. This is all working fine. However, in a discussion with another developer, we started questioning whether this will always work. Are there conditions under which the FileSystemWatcher will miss the creation of files? If so, what are these conditions? In

FileSystemWatcher stops catching events

≡放荡痞女 提交于 2019-12-28 13:45:09
问题 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 catching any events. I'm guessing that it might be losing connection to the server or there is a glitch in the network. How can I handle this situation in the code. Is there some exception I can watch for and try to restart the FileSystemWatcher object. Any suggestions and code samples would be appreciated

FileSystemWatcher used to watch for folder/file open

旧街凉风 提交于 2019-12-28 02:11:08
问题 I have browsed around but cannot find any information on what I am seeking, if there is another post that already goes over this then I apologize. I am seeking help with code that will monitor a specific folder for when the folder is opened by another person or when a file under said folder is opened. At this point I can see when a user opens and modifies any files but if they just open the file to view it, it does not throw an event even when I add LastAccessed. Any information or help would