Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top