-
Notifications
You must be signed in to change notification settings - Fork 215
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
Strange paths in events on windows #95
Comments
I should also mention that trying to strip out those leading characters from the path doesn't work; the path doesn't seem to think they are in there, despite the fact that when printed, it definitely is. It also won't allow me strip its actual prefix ( |
Good catch. |
Thanks for the quick response. I was trying to strip the prefix like this: let actual_path = event.path.unwrap();
let better_path = actual_path.strip_prefix(Path::new("\\\\?\\")).unwrap(); Since posting, I've managed to circumvent the issue by converting let path_string = actual_path.to_str().unwrap().to_string();
let better_path = Path::new(path_string.trim_left_matches("\\\\?\\")).to_path_buf(); |
I'm presently relying on the version of rsnotify direct from github, since the version on crates.io doesn't seem to have any way of tracking renames, or if it does, it isn't documented.
However, when watching a directory (in my case
C:\Users\Daniel\dir1
), the create notification (and maybe others too, but it crashes before I can check them) has a path with a whole bunch of leading slashes:\\?\C:\Users\Daniel\dir1\New Text Document.txt
I imagine this has something to do with partitions or volumes or some such, but it makes it pretty tricky to access the file.The text was updated successfully, but these errors were encountered: