Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fs.watch should tell if it is supported #4005

Closed
buschtoens opened this Issue · 4 comments

3 participants

@buschtoens

According to the api fs.watch isn't compatible with every system. It should throw when it isn't supported, so devs know.

@bnoordhuis bnoordhuis closed this issue from a commit
@bnoordhuis bnoordhuis doc: fs: clarfify fs.watch() documentation
fs.watch() is implemented on all supported platforms but, depending on the
object being watched, doesn't always work reliably (or at all).

Fixes #4005.
58a5bc1
@bnoordhuis

Thanks, addressed in 58a5bc1.

@buschtoens

Thanks.

Does fs.watch reliably work on Windows? Heard it has some issues.

@piscisaureus

It has some issues indeed:

  • It locks the directory that contains the watched directory. This is a limitation of the windows API.
  • It may report DOS 8.3 filenames sometimes. This is also a limitation of the windows API.
  • It may behave weird when the watched directory is moved or renamed.
@buschtoens

So can we safely say, that all other major platforms (Linux and OS X) are supported without issues? If so it would be best for devs to use fs.watch as long as process.platform != 'win32' and switch to the lame, polling fs.fileWatcher if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.