-
-
Notifications
You must be signed in to change notification settings - Fork 966
Inconsistent behavior of WatchList on Windows and Unix #609
Copy link
Copy link
Closed
Labels
Description
Describe the bug
The WatchList() function returns the exact file on linux, while the parent folder on Windows.
To Reproduce
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/fsnotify/fsnotify"
)
func main() {
watcher, _ := fsnotify.NewWatcher()
defer watcher.Close()
f, _ := filepath.Abs("test.txt")
os.Create(f)
watcher.Add(f)
fmt.Printf("WatchList: %v\n", watcher.WatchList())
}> go run .
WatchList: [F:\tmp\fsnotify_t]
> wsl go run .
WatchList: [/mnt/f/tmp/fsnotify_t/test.txt]Which operating system and version are you using?
Windows 11 Professional 23H2 (22631.3374)
Arch Linux WSL (kernel 5.15)
Which fsnotify version are you using?
main branch
Did you try the latest main branch?
Yes
Reactions are currently unavailable