Gibt es eine Haskell-Bibliotheksfunktion, um eine Datei ohne Polling zu überwachen?Haskell: Eine Datei ohne Polling überwachen (à la inotify in linux)
Mit Polling würde ich sowas wie folgt tun:
monitor file mtime handler = do
threadDelay n -- sleep `n` ns
t <- getModificationTime file
if t > mtime
then handler >> monitor file t handler
else monitor file mtime handler
Was ich will, ist so etwas wie eine Blockierung getModificationTime die durch das System aufgeweckt wird. Ist etwas verfügbar?
würde ich vollkommen zufrieden sein, wenn es nur für Posix-Systeme zur Verfügung, aber die mehr tragbar, desto besser :-)
Edit: Ich weiß hinotify, aber ich bin auf einem Mac (das ist warum erwähne ich POSIX).
Ein Wrapper um 'hinotity' und' kqueue' kann je nach Plattform interessant sein. – singpolyma
Interessante Frage. Sorry zu _me too_ this, gibt es irgendetwas unter Windows? – AndrewC