Domanda

I use several applications which upload files using the SFTP protocol to a specific directory on my server. I'ld like to write an application which will be deployed on my server, using the Java or Python programming language. This application has to be notified when a new file has been added to the directory. I'ld like to do this without polling the directory. Is this possible?

È stato utile?

Soluzione

Yes - for Java 7 use a WatchService. For Python see pyinotify.

The underlying mechanism is inotify, and you can produce shell-level solutions which use inotify-tools to run a small helper application every time a file is added.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top