notify
notify copied to clipboard
Expose isDir
Would it be possible to expose the isDir
function in EventInfo
?
Currently I have to reimpement it for every platform, e.g. for Linux:
func IsDir(e notify.EventInfo) {
inotifyEvent, ok := e.Sys().(*syscall.InotifyEvent)
if !ok {
return false
}
return inotifyEvent.Mask&syscall.IN_ISDIR != 0
}
From what I can tell it's currently implemented for all platforms, except kqueue, but maybe the kqueue implementation can be the same as the one for Windows (plain Stat()
+ IsDir
check).
@rjeczalik What do you think?
@martinp If we just export it instead of adding to EventInfo
(it would be a backward-incompatible change) then it sounds good to me.
Agreed, it would be better to not break the EventInfo
interface.