Comments (6)
However, you could wrap aound the module a bit to include the symbolic files by hand. Sample code:
var watch = require('node-watch');
function findSymLinkFiles(dir) {
// will return an array of sym link files.
// using fs.readLink or something
}
exports.watchAll = function(dir, options, callback) {
var all = [dir].concat(findSymLinkFiles(dir));
watch(all, options, callback);
}
from node-watch.
Which version of node are you running?
from node-watch.
node -v
shows v0.10.13
from node-watch.
I've just tested with fs.watch(). It seems the original fs.watch() won't report on symbolic links of files when watching a directory. However, I remember in older version of nodejs it worked just fine. Maybe just another bug with fs.watch().
//EDIT
The followSymLinks
and maxSymLevel
option are here only to prevent infinite symbolic directory references in recursive function.
from node-watch.
I see, then why not support "symlink under a watching directory"? Just like my scenario.
from node-watch.
I dont know actually. It's the problem with underneth notification system of the nodejs core.
One reasonable explaination is that because the symbolic file is linked to another place. No mater of what modifications to its content, the symbolic itself always remains the same. So the callback function will not be triggered. But if you were to rename the symbolic file in the current directory it would behave as we expected.
from node-watch.
Related Issues (20)
- Follow symlink HOT 2
- watch dir bug HOT 2
- Calling close() before the watcher is ready does nothing HOT 2
- Avoid synchronous fs calls HOT 1
- Catch errors when adding watchers for child directories HOT 1
- Catch error when use Node 14.15.3 on Linux SysTem HOT 2
- I got this error at first use lib in nodejs using express HOT 2
- node-watch is not working recursive in Ubuntu under WSL HOT 5
- when watch a dir that mount by nfs, if not work HOT 2
- New ES syntax HOT 2
- Only pass skip on initial recurse
- Travis CI is no longer free, try to switch to GitHub CI
- Fix tests on Windows
- fs.watch() not detecting changes to file from git operation HOT 3
- images update problem HOT 3
- Can TEMP_DIR able to change ?
- Is there a way, or a best practice to scan this large amount of files for processing ? HOT 4
- Add ignore option HOT 7
- multiple events for a file sent over network HOT 2
- High CPU consumption on window service HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-watch.