Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FileSystemWatcher for FTP

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.

like image 634
softwarematter Avatar asked Aug 14 '09 10:08

softwarematter


1 Answers

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 nothing in the FTP protocol that will help you with this unfortunately.

like image 89
Lasse V. Karlsen Avatar answered Oct 11 '22 11:10

Lasse V. Karlsen