Closed Rohansi closed 6 years ago
Will get back to you on this next week
Not sure I like the idea of returning null, as it makes the API unbalanced (compare for example to OpenStream that doesn't return null if it can't, even if it is slightly different) and having potential null around is often an annoyance if you are not aware of it...
What about adding a CanWatch
method?, maybe also by adding a default implementation to the FileSystem base, returning true, that could simplify the implementation trouble of having to add a new method...
What do you think?
A CanWatch
method sounds good. Would it check a given path or be for the entire IFileSystem
instance?
There's also the option of a NullFileSystemWatcher
that doesn't do anything but I'm not a fan of that.
A CanWatch method sounds good. Would it check a given path or be for the entire IFileSystem instance?
I would say it takes a path, so that it allows fine-grained control there.
This was fixed by #18.
What should a filesystem that doesn't support watching do? I'm thinking returning
null
might be better than throwing because we should allow watching on composites (aggregate, mount) even when one of the filesystems cannot be watched.What do you think?