質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top