Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"The parameter is incorrect." error when watching files on Windows #225

Open
goodsky opened this issue Feb 19, 2024 · 3 comments
Open

"The parameter is incorrect." error when watching files on Windows #225

goodsky opened this issue Feb 19, 2024 · 3 comments

Comments

@goodsky
Copy link

goodsky commented Feb 19, 2024

Trying to watch a file on Windows returns this error "The parameter is incorrect." A simple example that reproduces this issue.

root := "./test.txt" // this file exists
events := make(chan notify.EventInfo, 100)

if err := notify.Watch(root, events, notify.All); err != nil {
   log.Fatal(err)
}

I have my suspicion that this may be related to my Go installation or disk setup. I will continue to debug, but posting here in case someone else has seen this before.

@ReallyLiri
Copy link

I haven't seen such error on Windows, could it be permissions to the current directory? Did you try different paths?

@mitranim
Copy link

mitranim commented Sep 9, 2024

Just ran into the same problem on Windows. Seems to happen when watching one file. Doesn't seem to happen when watching a directory. The error does not occur when passing 0 or when not passing any Event values.

I don't think it's related to file permissions. I tried placing the target file into my user directory, and then into a subdirectory there. Should be perfectly accessible.

@mitranim
Copy link

mitranim commented Sep 10, 2024

As the error text doesn't appear (fully or partially, as far as I could tell) in this library or any of its Go dependencies, I would guess that it's coming from Windows syscalls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants