-
Notifications
You must be signed in to change notification settings - Fork 225
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
Filenames without path not handled on Windows #90
Comments
What would be the behaviour you're looking for here? Watch the current directory? |
Yeah. The need for watching the parent directory on Windows is an implementation detail that shouldn't effect behavior. I don't have access to any of the other OS', but I'm betting that this behavior is inconsistent across. |
I think we could resolve the path to absolute before passing it to the backend. What do you think @Hessijames? |
Will be fixed in the next release, until then you can use: |
Maybe path.canonicalize() would be better. I think your current patch would fail on network files, i.e. "//network-computer/shared-folder/file.txt". |
Good point. I wasn't able to test it, but using canonicalize() seems better anyway. |
Btw, I'm receiving 2 |
Yes, this is known. There are plans to provide debounced events for that reason, see #63. |
As mentioned in issue #95, canonicalize() uses returns \?\ style paths. That can be confusing when a "normal" path was passed to watch(). So I reverted the "canonicalize" commit and went back to using env::current_dir(). This time I tested it with network shares and it does work. So I can't see any problems. |
Supplying
watch()
with just a filename and no path will result in a "parent directory could not be opened" error.This is because
Path.parent()
doesn't return the actual path to the parent directory, but rather the original path minus the last entry, resulting in an empty string when given just a filename.The text was updated successfully, but these errors were encountered: