Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running fs.watch on a Vagrant vm and changing a file through the host machine, the change is not detected #6765

Closed
miparnisari opened this issue May 14, 2016 · 2 comments
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.

Comments

@miparnisari
Copy link

miparnisari commented May 14, 2016

  • Version: node 4.1.2
  • Platform: Ubuntu 64-bit
  • Subsystem: fs

Not sure whether this is known behavior or a bug.

I'm running Ubuntu on a Vagrant virtual machine and I have set up a shared folder so changes to the folder and all subfolders are in sync. However, if I run fs.watch('/folder') in the VM and change a file in that folder through the host (Windows), the change is not detected.

@mscdex mscdex added the fs Issues and PRs related to the fs subsystem / file system. label May 15, 2016
@bnoordhuis bnoordhuis added the doc Issues and PRs related to the documentations. label May 15, 2016
@bnoordhuis
Copy link
Member

That's a shortcoming of the way Vagrant exposes the host file system to the guest. The documentation touches on it in an indirect way:

If the underlying functionality is not available for some reason, then
`fs.watch` will not be able to function.  For example, watching files or
directories on network file systems (NFS, SMB, etc.) often doesn't work
reliably or at all.

(NFS and SMB are commonly used protocols for mapping the host file system.)

You can use fs.watchFile() instead. I've added the doc label; we can probably add one or two lines on virtualization software. /cc @nodejs/documentation

@eljefedelrodeodeljefe
Copy link
Contributor

On it in #6809

Fishrock123 pushed a commit that referenced this issue May 23, 2016
Fixes: #6765
PR-URL: #6809
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
rvagg pushed a commit that referenced this issue Jun 2, 2016
Fixes: #6765
PR-URL: #6809
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins pushed a commit that referenced this issue Jun 3, 2016
Fixes: #6765
PR-URL: #6809
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins pushed a commit that referenced this issue Jun 24, 2016
Fixes: #6765
PR-URL: #6809
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
MylesBorins pushed a commit that referenced this issue Jun 24, 2016
Fixes: #6765
PR-URL: #6809
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

No branches or pull requests

4 participants