howeyc/fsnotify

Expose the wd ?

Terry-Mao opened this issue · 3 comments

If i watch a file and a dir, without the wd how can i distinguish file and dir?

Basically like embedding the os.FileInfo inside the FileEvent structure?

Also, couldn't you just call os.Stat()?

such as:
addWatch(file)
then
addWatch(dir)
and other addWatch.....

if file and dir have same name, it's hard to handle this situation...
in my view, addWatch return the wd to the caller, so one can use the wd to distinguish all the watch path

sth like:

if ev.WD == myfilewd {
} else ev.WD == mydirwd {
}

Which OS lets you have a file and directory of the same name at the same time?