Questions tagged [filesystemwatcher]

FileSystemWatcher is a .NET component class that listens to the file system change notifications and raises events when a directory, or file in a directory, changes.

Filter by
Sorted by
Tagged with
1 vote
1 answer
26 views

Unable to find events being raised when log file changed

Im trying to use FileSystemWatcher to watch a file and check for changes, when a change occurs it should run aa command, this works when im saving the file in notepad, however not from the actual ...
Mason Kerr's user avatar
0 votes
0 answers
31 views

FileSystemWatcher.Changed event gets triggered when shared excel file is closed

I'm using the FileSystemWatcher.Changed event in my VB.NET application to track changes in files, mainly Excel files. I have used NotifyFilters.LastWrite Or NotifyFilters.Attributes. I have observed ...
IT Researcher143's user avatar
1 vote
1 answer
28 views

How can I pass variables into a Powershell ObjectEvent action

I'm writing a tool which will take an action whenever a new file is written into a folder on a windows server. I'm using the following $action = { write-host "action fired" Process-file $...
Ian's user avatar
  • 269
0 votes
0 answers
71 views

How to use FileSystemWatcher with FIFO processing in C#

How to use the FileSystemWatcher with FIFO processing? The FileSystemWatcher trigger event whenever the files are pasted in the directory, so I want to perform one file at a time as first in first out ...
Suresh S's user avatar
0 votes
0 answers
10 views

Can VS Code watch changes to files mounted via NFS in WSL?

One very helpful feature of VS Code and its extensions is the ability to watch files and folders and react if they change. In the VS Code API, this is implemented by FileSystemWatcher. If I mount an ...
maf's user avatar
  • 305
1 vote
0 answers
35 views

In powershell, how do I process only a single event after a file modification?

Right now, I am attempting to manage boolean flags via a global hashtable: # Context: System.IO.FileSystemWatcher # File Event: 'Changed' $global:sourceId2Flag = @{} ... $objectEventArgs = @{ ... ...
Chris's user avatar
  • 29k
0 votes
0 answers
11 views

Matlab: Delay in displaying messages in parallel threads with fileSystemWatcher

I need to figure out why there is a delay in the display of the messages in the code below. I have tracked the delay to the spmdReceive() in spmdIndex ==2 and 3, but I am not sure what to do next. The ...
QQP's user avatar
  • 47
2 votes
0 answers
23 views

When use fanotify, files from deleted directory have incorrect path

When I use fanotify for listening to file changes, when I delete a folder in the root directory, the files under this folder appear with (deleted) characters, for example: /data/service/el2/100/hmdfs/...
xzq's user avatar
  • 21
0 votes
0 answers
110 views

How to notify the FileSystemWatcher that file copy either from same machine or another machine completes and start processing

I have below program where StartFileWatcher looking into a folder (C:\TEMP) (including subdirectories) and copying all the files info to the C# channel based of file LastWriteTimeUtc and having some ...
user584018's user avatar
  • 10.2k
0 votes
0 answers
21 views

Python Watchdog Catch the pid of the file even not only the path

I facing the issue where there are too many file being written, modifed and sometime removed on the system I was able to log the files and path changed and sort of event logged on them using Python ...
YazeedHasan's user avatar
0 votes
0 answers
7 views

Is it posible to get multiple selected files from dialogbox or textbox to FileSystemWatcher instead of just directory?

I am selecting multiple files through a dialogbox and showing the complete path with filenames and extensions in TextBox1.text. I am wondering if we can grab the files with complete path and extension ...
Aamir Karim's user avatar
0 votes
0 answers
23 views

System Argument Error from direct file location and TextBox1

I am creating a project which will convert xls to xlsx, doc to docx and ppt to pptx using Spire libraries. I am browsing files and then saving the files complete location to TextBox1.text. I get the ...
Aamir Karim's user avatar
0 votes
0 answers
56 views

I'm writing a code for fanotify to listen a filesystem

I'm writing a code for fanotify to listen a filesystem, but I'm having trouble writing a file move-in and move-out event, and I'd like to ask if a file is moved in a file system that's being listened ...
xzq's user avatar
  • 21
0 votes
1 answer
24 views

How to get more information about FileSystemWatcher events?

The code from https://learn.microsoft.com/en-us/dotnet/api/system.io.filesystemwatcher?view=net-7.0 reports about ten events per new file, something like "Created, Deleted, Created, Changed, ...
TryingToLearn's user avatar
0 votes
1 answer
71 views

FileSystemWatcher InternalBufferSize limit is getting exceeded

We are receiving files in FileSystemWatcher folder very frequently because of that InternalBufferSize limit is getting exceeded and files are being missed. I am using the max limit 65536 allowed for ...
Ravi Kumar's user avatar
0 votes
0 answers
23 views

Watching Windows file system events, tool, util?

I am debugging my own file-system driver, and I need to make sure I send all the correct events, just like NTFS. So I need a way to see all the events for a volume or directory. So I came across a ...
lundman's user avatar
  • 1,616
0 votes
1 answer
74 views

Check if file is changed by an external application

I'm creating a kind of file-editor in WPF, what is the best practice to check if a file has been changed outside of my own WPF application? I know I can track files with the System.IO....
LecArne's user avatar
  • 417
0 votes
2 answers
224 views

Spring Boot application with File Change Listener cannot initiate repository service

Introduction In my spring boot application, I need a feature to read files from a monitored directory with a listener on it, then parse/upload into postgresql database once it finds a file. Client ...
Yaz's user avatar
  • 1
0 votes
0 answers
17 views

Is there a way to prohibit copying, deleting, or saving specific file types on disk on Windows 10/11?

Is it possible on Windows 10/11 to control the deletion or copying of files of a certain type to the disk. For example, I would like to prohibit the possibility of copying, deleting or saving an excel,...
SzakiII's user avatar
  • 11
-1 votes
1 answer
62 views

File not found even though it is there. .doc and .txt work but .jpg and .png don't

I have this code: public void OnCreated(object sender, FileSystemEventArgs file) { Console.WriteLine("created called"); string[] files = Directory.GetFiles($"{textBox2.Text}&...
AmsterdamGhoul's user avatar
2 votes
2 answers
44 views

Can't use watcher.Filters.Add() function in .sln project

I am creating a project and I am using FileSystemWatcher, however I need to add multiple filters and watcher.Filters.Add() doesn't work. I am using .NET Framework ver. 4.8 and have .NET core 7.0.203 ...
AmsterdamGhoul's user avatar
0 votes
2 answers
165 views

Watching a folder for New Files and determine when file copy is finished

I am using fileSystemWatcher in C# winforms to monitor new files and folders created in the c:\Backup Folder, my clients transfer files to this folder and my application is supposed to zip newly ...
Mohsen K's user avatar
  • 257
0 votes
0 answers
10 views

Is there any possibility to get the last modified user details of file in C# without using Auditing or event logs

I am developing Windows service using Filesystemwatcher to monitor the folder(File share) configured in application. Along with capturing the created,removed, renamed ,changed etc event we need to get ...
Neelima P's user avatar
0 votes
1 answer
22 views

Register-ObjectEvent ghost instance running

I am using New-Object System.IO.FileSystemWatcher / Register-ObjectEvent (Powershell) to monitor a folder for new files and perform action. It is being run as a scheduled task under a service user ...
maifosz's user avatar
  • 55
0 votes
0 answers
16 views

How get user details who modified files in fileshare in c#

I need to implement windows service which monitors a folder in fileshare, it should trigger all events like change,create,delete,rename,security changes,open,write and audit level events . Along with ...
Neelima P's user avatar
0 votes
1 answer
51 views

VB.NET Updating UI and controls in real time

I am trying to make a CheckedListBox_Notifications that shows items listing the changes happening in a specific directory. Upon the load of the form I have the code: Public Watcher_ActiveProjects ...
Eduards's user avatar
  • 68
1 vote
1 answer
70 views

FileSystemWatcher throws System.IO.InternalBufferOverflowException in C# Windows Form [closed]

I created an application in C# that continuously listens to a folder for new file additions, once a new file is added, it picks up that file and uploads it to an S3 bucket. I tested the application ...
Ashley Pow's user avatar
1 vote
2 answers
269 views

How to create a queue to store incoming files added to a folder, when more than one file is dropped in at a time?

I made a service which monitors a folder to see when a new file is added. When a new file is added, the file is broken down by line (each line is stored in a list), and the data stored in each line is ...
GStack11's user avatar
0 votes
0 answers
10 views

how to stop my FileSystemWatcher in start/stop button

I have a FileSystemWatchers monitoring 1 location in a Start/stop Button, but I can´t manage to stop it, the button works pretty much well as when I click on it, it reads the code when it is off (the ...
Fer's user avatar
  • 13
0 votes
0 answers
34 views

Do Loop handling Queue Events displaying multiple host output from one event powershell

I have a script that monitors a directory for csv file changes and displays the results on the screen as an output. But when a single file has changed i.e. one event multiple lines appear in the ...
Iain Howard's user avatar
0 votes
0 answers
61 views

FileSystemWatcher: Last Write Date of Deleted File?

Watching the filesystem with FileSystemWatcher. When a file is deleted I want to get the last write date of that file. Do I have to sample a baseline of all files monitored when my script starts or ...
stackedyellowangel's user avatar
1 vote
1 answer
86 views

ConfigurationManager.OpenMappedExeConfiguration "because it is being used by another process"

I'd like to re-read the MySolution.main.config (my app.config) thanks FileSystemWatcher when users modify it. I built a wrapper called FileWatcher. Catching OnChanged event with this piece of code ...
lunatic84's user avatar
  • 300
0 votes
0 answers
31 views

C# FileSystemWatcher.Renamed NoRename not in context

I am writing a hotfolder application to pull files as they enter an FTP site and move them to another server. On large file the file is name file.FilePart until complete so I need to catch the file ...
twbass's user avatar
  • 11
0 votes
1 answer
454 views

How to use Clipboard.Default.SetTextAsync in MAUI with FileSystemWatcher

I have followed https://learn.microsoft.com/en-us/dotnet/maui/platform-integration/data/clipboard?view=net-maui-7.0 in my project, and I understand that: Access to the clipboard must be done on the ...
McoreD's user avatar
  • 313
0 votes
0 answers
76 views

Use a fileSystemWatcher script to run a batchfile in an unspecified destination

The following code will watch for any new jpeg images in the “c:\a\b\” directory and subdirectories: #monitors folders with new files $watcher = New-Object System.IO.FileSystemWatcher #perameter that ...
Sceptersax's user avatar
2 votes
0 answers
126 views

Powershell FileSystemWatcher: How can I tell when changes are complete?

The situation: I have a .bat script running every five minutes that does some processing on a set of files on a network drive, and then writes the results to another location. Some other process in ...
ttttttt's user avatar
  • 21
0 votes
0 answers
33 views

What algorithm does FileSystemWatcher in C# use to monitor file system changes? [duplicate]

I wish to understand how FileSystemWatcher monitors changes. Is there a central set of Windows system API that are central conduit for creation, removal, changing of file system objects, such that ...
Blessed Geek's user avatar
  • 21.1k
1 vote
1 answer
53 views

Using Filesystemwatcher to rename a monitored file to a directory one level higher than it's own directory

I have a script that will use filesystemwatcher to monitor a folder and it's subdirectories for a new file. Once it detects the new file, it will then rename the file to the directory that the file ...
Sceptersax's user avatar
0 votes
1 answer
72 views

How to Forward Notifications with FileSystemWatcher and Incoming Webhook

I'm trying to make it so that whenever there are changes in the watch folder I get a notification by teams. I did the monitoring code with FileSystemWatcher, but when it's time to notify Teams of the ...
Marck's user avatar
  • 71
-1 votes
3 answers
63 views

Add event to FileSystemWatcher when property EnableRaisingEvents changed

I have created a custom class Public Class MyFSW Inherits FileSystemWatcher Public Property ParentForm As Form Public Property TabPage As TabPage End Class Now I want to add a custom ...
Tobias G.'s user avatar
0 votes
1 answer
63 views

Identify parent of FileSystemWatcher

I have a TabControl in my main form and in every TabPage is a form dynamicially added. These (sub)forms contain severeal controls (textboxes, checkboxes, etc.) and also a FileSystemWatcher. When ...
Tobias G.'s user avatar
1 vote
2 answers
101 views

PowerShell IO.FileSystemWatcher doesn't work after restart fileserver

I need a FileSystemWatcher on a network directory (fileserver) The script works well but fails after a reboot from the fileserver. How can I detect if the FSW is failing and restart the watcher if the ...
deca's user avatar
  • 51
0 votes
0 answers
125 views

FileSystemWatcher Not Working with UNC Paths. Wrong Implementation or Alternatives to FileSystemWatcher?

Hi I created a service to monitor several UNC paths. The goal of the watcher is to monitor several folders. When a new file is created it will trigger a launch of a file converter for that specific ...
Datboydozy's user avatar
0 votes
0 answers
151 views

How to manage credentials across servers in different domains?

I'm working on a project where I am automating my company's processes. Our setup is as follows: Every employee is on an independent local machine There are three remote servers involved in this ...
Inflorescence's user avatar
0 votes
2 answers
232 views

How can you use the Deno.watchFs infinite async iterable without blocking?

So Deno has a filesystem watcher API that seems... obtuse to me. Perhaps that's simply due to my ignorance of async iterators. It's shown to be used like so: const watcher = Deno.watchFs("/...
Chris_F's user avatar
  • 5,015
1 vote
1 answer
106 views

How can I determine which file filter was matched for a FileSystemWatcher event?

I am using a FileSystemWatcher as follows: using watcher = new FileSystemWatcher(@"C:\path\to\folder"); watcher.NotifyFilter = NotifyFilters.Attributes | NotifyFilters....
Om Palsanawala's user avatar
0 votes
0 answers
71 views

How FileSystemWatcher can make sure that file is copied completely?

I have a widows service that is using FileSystemWatcher to monitor an incoming folder, I am dropping files to this folder and moving files to the working folder on the change event. There is a problem ...
Vivek Nuna's user avatar
  • 25.7k
0 votes
0 answers
60 views

Dynamically created FileSystemWatcher Not Working

I posted a question here but deleted it after I found a rather tedious solution I am trying to write an app that can monitor multiple folders. I looked at the following solutions: FIleSystemWatcher ...
Datboydozy's user avatar
1 vote
0 answers
62 views

FileSytemWatcher: GetLongPathName for a deleted file

I have the following function: [DllImport("kernel32.dll", CharSet = CharSet.Auto)] public static extern int GetLongPathName( [MarshalAs(UnmanagedType.LPTStr)] string path, [...
H44R's user avatar
  • 13
0 votes
1 answer
33 views

VB.et FileSystemWatcher Event Handler - Calls of Handler Repeats (Unwanted)

I'm trying to log file activity in a directory with the FileSystemWatch class by adding the file to a custom class within a list, unfortunately, it seems that when copying a file or adding a new file ...
hackedsolutions's user avatar

1
2 3 4 5
25