inotify reports paths relative to directory being watched
Sponsored-by: Dartmouth College's DANDI project
This commit is contained in:
parent
e07625df8a
commit
7503b8448b
1 changed files with 5 additions and 4 deletions
|
@ -199,13 +199,13 @@ tailVerify iv f finished =
|
||||||
inotifycreate i cont = INotify.addWatch i evs (P.takeDirectory f) $ \case
|
inotifycreate i cont = INotify.addWatch i evs (P.takeDirectory f) $ \case
|
||||||
-- Ignore changes to other files in the directory.
|
-- Ignore changes to other files in the directory.
|
||||||
INotify.Created { INotify.filePath = fn }
|
INotify.Created { INotify.filePath = fn }
|
||||||
| fn /= f -> noop
|
| fn /= basef -> noop
|
||||||
INotify.MovedIn { INotify.filePath = fn }
|
INotify.MovedIn { INotify.filePath = fn }
|
||||||
| fn /= f -> noop
|
| fn /= basef -> noop
|
||||||
INotify.Opened { INotify.maybeFilePath = fn }
|
INotify.Opened { INotify.maybeFilePath = fn }
|
||||||
| fn /= Just f -> noop
|
| fn /= Just basef -> noop
|
||||||
INotify.Modified { INotify.maybeFilePath = fn }
|
INotify.Modified { INotify.maybeFilePath = fn }
|
||||||
| fn /= Just f -> noop
|
| fn /= Just basef -> noop
|
||||||
_ -> cont
|
_ -> cont
|
||||||
where
|
where
|
||||||
evs =
|
evs =
|
||||||
|
@ -215,6 +215,7 @@ tailVerify iv f finished =
|
||||||
, INotify.Open
|
, INotify.Open
|
||||||
, INotify.Modify
|
, INotify.Modify
|
||||||
]
|
]
|
||||||
|
basef = P.takeFileName f
|
||||||
|
|
||||||
go = INotify.withINotify $ \i -> do
|
go = INotify.withINotify $ \i -> do
|
||||||
h <- waitforfiletoexist i
|
h <- waitforfiletoexist i
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue