Closed aravindavk closed 5 years ago
hm I think instead of doing try/catch it would be better performing a stat
and checking for ENOENT and otherwise throw a FileException
from fswatch. The stat result would then contain if it is a directory.
file.getAttributes
also throws FileException, please suggest which one use to get stat
.
If a file is created and deleted immediately,
isDir
check is failing with FileException. With this patch, error is ignored in case of ENOENT.Reproducer: Start the example program and create a file in watched directory using
vi
editor.Signed-off-by: Aravinda VK mail@aravindavk.in