-
Notifications
You must be signed in to change notification settings - Fork 252
howeyc/fsnotify watch in window and linux problem, it‘s have some err #113
Comments
I use the example support by yours. |
You can try using https://github.com/go-fsnotify/fsnotify which has some bugfixes that haven't been incorporated into howeyc/fsnotify. Though it may not fix things like multiple modify events, particularly if you are triggering these changes with a text editor. Editors are notorious for causing issues like that https://github.com/go-fsnotify/fsnotify/issues/17. |
Thank you, |
I use an edition maybe print more. could you explain the different between "echo "bb" > test.txt" and |
I konw "echo "bb" >> test.txt" , clean the file then write,but after clean it don't save the file. |
If you're just using echo it shouldn't have the problems I mentioned about editors. Hm. I'm not sure. 😦 |
Having the same problem that it returns 2 events instead of one (using with echo) |
@pkutishch Would you mind trying against the latest version by running the following in terminal/console: go get -u github.com/fsnotify/fsnotify and changing import paths to: import "github.com/fsnotify/fsnotify" If echo is still a problem, please open a new issue there. Thanks! |
OS:window7
folder
create:
"D:\test\新建文件夹": CREATE
rename
2015/11/24 15:02:39 event: "D:\test\新建文件夹": RENAME
2015/11/24 15:02:39 event: "D:\test\test": RENAME
delete
2015/11/24 15:03:12 event: "D:\test\test": DELETE
MODIFY
2015/11/24 15:04:37 event: "D:\test\ww": MODIFY
file
create
2015/11/24 15:05:33 event: "D:\test\新建文本文档.txt": CREATE
rename
2015/11/24 15:05:52 event: "D:\test\新建文本文档.txt": RENAME
2015/11/24 15:05:52 event: "D:\test\test.txt": RENAME
2015/11/24 15:05:52 event: "D:\test\test.txt": MODIFY
why print MODIFY?
MODIFY
2015/11/24 15:06:14 event: "D:\test\test.txt": MODIFY
2015/11/24 15:06:14 event: "D:\test\test.txt": MODIFY
2015/11/24 15:06:14 event: "D:\test\test.txt": MODIFY
why this line run 3times?
delete
2015/11/24 15:08:15 event: "D:\test\test.txt": DELETE
OS:centos
folder
create:
2015/11/24 15:11:52 event: "/root/桌面/test/untitled folder": CREATE
rename
2015/11/24 15:12:23 event: "/root/桌面/test/untitled folder": RENAME
2015/11/24 15:12:23 event: "/root/桌面/test/test": CREATE
delete
2015/11/24 15:17:18 event: "/root/桌面/test/test": RENAME
MODIFY
nothing
file
create
2015/11/24 15:20:10 event: "/root/桌面/test/new file": CREATE
rename
2015/11/24 15:20:31 event: "/root/桌面/test/new file": RENAME
2015/11/24 15:20:31 event: "/root/桌面/test/test": CREATE
MODIFY
2015/11/24 15:20:58 event: "/root/桌面/test/.gedit-save-D5SP8X": CREATE
2015/11/24 15:20:58 event: "/root/桌面/test/.gedit-save-D5SP8X": MODIFY|ATTRIB
2015/11/24 15:20:58 event: "/root/桌面/test/.gedit-save-D5SP8X": MODIFY|ATTRIB
2015/11/24 15:20:58 event: "/root/桌面/test/.gedit-save-D5SP8X": MODIFY|ATTRIB
2015/11/24 15:20:58 event: "/root/桌面/test/.gedit-save-D5SP8X": MODIFY
2015/11/24 15:20:58 event: "/root/桌面/test/.gedit-save-D5SP8X": MODIFY
2015/11/24 15:20:58 event: "/root/桌面/test/.gedit-save-D5SP8X": MODIFY
2015/11/24 15:20:58 event: "/root/桌面/test/test": RENAME //rename
2015/11/24 15:20:58 event: "/root/桌面/test/.gedit-save-D5SP8X": RENAME
2015/11/24 15:20:58 event: "/root/桌面/test/test": CREATE
2015/11/24 15:20:58 event: "/root/桌面/test/test~": DELETE
About file test only 2 lines but it's rename and create
delete
2015/11/24 15:29:53 event: "/root/桌面/test/test": RENAME
func main() {
watcher, err := fsnotify.NewWatcher()
if err != nil {
log.Fatal(err)
}
}
if i watch a file ,
package main
import (
"log"
//"fmt"
"github.com/howeyc/fsnotify"
)
func test(){
log.Println("test")
}
func main() {
watcher, err := fsnotify.NewWatcher()
if err != nil {
log.Fatal(err)
}
}
when i MODIFY the file test.txt it's only print in the first time . in windows it's print 3times
The text was updated successfully, but these errors were encountered: