码迷,mamicode.com
首页 > 其他好文 > 详细

fs.watchFile

时间:2017-03-19 01:52:08      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:html   gets   logs   技术分享   api   mit   lis   tin   persist   

fs.watchFile

fs.watchFile(filename[, options], listener)

  Watch for changes on filename. The callback listener will be called each time the file is accessed.

  The options argument may be omitted. If provided, it should be an object. The options object may contain a boolean named persistent that indicates whether the process should continue to run as long as files are being watched. Theoptions object may specify an interval property indicating how often the target should be polled in milliseconds. The default is { persistent: true, interval: 5007 }.

  The listener gets two arguments the current stat object and the previous stat object:

  技术分享

  These stat objects are instances of fs.Stat.

参考:https://nodejs.org/dist/latest-v6.x/docs/api/fs.html

fs.watchFile

标签:html   gets   logs   技术分享   api   mit   lis   tin   persist   

原文地址:http://www.cnblogs.com/tekkaman/p/6576872.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!