on master help sign in
Use watchTreesWith to implement watchPathsWith
9444e3eHarendra Kumar
src/Streamly/Internal/FileSystem/Event/Windows.hs+9−9
@@ -411,15 +411,7 @@ watchPathsWith ::
411 (Config -> Config)
411 (Config -> Config)
412 -> NonEmpty (Array Word8)
412 -> NonEmpty (Array Word8)
413 -> SerialT IO Event
413 -> SerialT IO Event
414−watchPathsWith f paths =
415− S.bracket before after (S.concatMapWith parallel eventStreamAggr)
416−
417− where
418−
419− before =
420− let cfg = f $ setRecursiveMode False defaultConfig
414+watchPathsWith f = watchTreesWith (f . setRecursiveMode False)
421− in return $ pathsToHandles (utf8ToStringList paths) cfg
422− after = liftIO . closePathHandleStream
423
415
424-- | Like 'watchPathsWith' but uses the 'defaultConfig' options.
416-- | Like 'watchPathsWith' but uses the 'defaultConfig' options.
425--
417--
@@ -432,6 +424,14 @@ watchPathsWith f paths =
432watchPaths :: NonEmpty (Array Word8) -> SerialT IO Event
424watchPaths :: NonEmpty (Array Word8) -> SerialT IO Event
433watchPaths = watchPathsWith id
425watchPaths = watchPathsWith id
434
426
427+-- XXX
428+-- Document the path treatment for Linux/Windows/macOS modules.
429+-- Remove the utf-8 encoding requirement of paths? It can be encoding agnostic
430+-- "\" separated bytes, the application can decide what encoding to use.
431+-- Instead of always using widechar (-W) APIs can we call the underlying APIs
432+-- based on the configured code page?
433+-- https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page
434+--
435-- | Start monitoring a list of file system paths for file system events with
435-- | Start monitoring a list of file system paths for file system events with
436-- the supplied configuration operation over the 'defaultConfig'. The
436-- the supplied configuration operation over the 'defaultConfig'. The
437-- paths could be files or directories. When the path is a directory, the
437-- paths could be files or directories. When the path is a directory, the