fsnotify-0.3.0.1: Cross platform library for file change notification.

Safe HaskellNone
LanguageHaskell98

System.FSNotify.Devel

Description

Some additional functions on top of System.FSNotify.

Example of compiling scss files with compass

compass :: WatchManager -> FilePath -> IO ()
compass man dir = do
 putStrLn $ "compass " ++ encodeString dir
 treeExtExists man dir "scss" $ fp ->
   when ("deploy" notElem splitDirectories fp) $ do
    let d = encodeString $ head (splitDirectories rel)
    system "cd " ++ d ++ "&& bundle exec compass compile"
 return ()

Synopsis

Documentation

treeExtAny Source #

Arguments

:: WatchManager 
-> FilePath

Directory to watch

-> Text

extension

-> (FilePath -> IO ())

action to run on file

-> IO StopListening 

In the given directory tree, watch for any events for files with the given file extension

treeExtExists Source #

Arguments

:: WatchManager 
-> FilePath

Directory to watch

-> Text

extension

-> (FilePath -> IO ())

action to run on file

-> IO StopListening 

In the given directory tree, watch for any Added and Modified events (but ignore Removed events) for files with the given file extension

doAllEvents :: Monad m => (FilePath -> m ()) -> Event -> m () Source #

Turn a FilePath callback into an Event callback that ignores the Event type and timestamp

allEvents :: (FilePath -> Bool) -> Event -> Bool Source #

Turn a FilePath predicate into an Event predicate that accepts any event types

existsEvents :: (FilePath -> Bool) -> Event -> Bool Source #

Turn a FilePath predicate into an Event predicate that accepts only Added and Modified event types