Go语言如何检测文件更改? [英] Go language how detect file changing?

查看:149
本文介绍了Go语言如何检测文件更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何使用Go检测文件何时更改。我知道Unix提供了一个名为 fcntl()的函数,它可以通知特定文件何时更改,但我在Go中没有找到这个函数。
请帮助我。

I need to know how to detect when a file changes using Go. I know that Unix provides a function named fcntl() which notifies when a specific file is changed but I have not found this one in Go. Please help me.

推荐答案

目前有一个实验软件包这里。它应该在go1.3中被合并到核心中作为 os / fsnotify

There is currently an experimental package here. It should be merged into core as os/fsnotify in go1.3

这篇关于Go语言如何检测文件更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆