Created
December 3, 2014 23:48
-
-
Save raytiley/31e1c5b3b2cfa2c2d608 to your computer and use it in GitHub Desktop.
Do some watching test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
fs.watch('watch-me', function (event, filename) { | |
console.log('event is: ' + event); | |
if (filename) { | |
console.log('filename provided: ' + filename); | |
} else { | |
console.log('filename not provided'); | |
} | |
}); | |
setTimeout(doLink, 2000); | |
setTimeout(doJunction, 4000); | |
function doLink() { | |
fs.link('./watch-me/watch-me.txt', './destination/watch-me.txt'); | |
console.log('Did Link'); | |
} | |
function doJunction() { | |
fs.symlink('./watch-me', './destination/watch-me', 'junction'); | |
console.log('did junction'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment