-
Notifications
You must be signed in to change notification settings - Fork 14k
fix: std::sys::fs use_with_native_path for read_dir for windows #148045
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
base: master
Are you sure you want to change the base?
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use |
This comment was marked as outdated.
This comment was marked as outdated.
85f3ca8 to
0527ec1
Compare
|
@rustbot label +O-windows |
|
cc @ChrisDenton |
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem to fix the issue. It just converts the path to wide and then back again, which is a quite expensive no-op.
But it is beginning of fixing the purpose using this function on all platforms. I covered it on windows, expensive no-op it is the function 'use_with_native_path' at all |
|
The purpose of the fixme is to clearly show that there's an issue to be fixed. This PR doesn't fix the issue, it merely hides the issue one level deeper and removes the fixme note. The performance impact of this is why it's a fixme instead of being implemented that way to start with. |
I didnt remove fixme comment Also i see some moments like: pub fn copy(from: &Path, to: &Path) -> io::Result<u64> {
// FIXME: use with_native_path on all platforms
#[cfg(not(windows))]
return imp::copy(from, to);
#[cfg(windows)]
with_native_path(from, &|from| with_native_path(to, &|to| imp::copy(from, to)))
}is it also expensive no-op? |
|
Yes, if |
|
@ChrisDenton Can you check now? I removed Path, but couldnt avoid from PathBuf because of DirEntry display info |
Fix the read_dir function in windows for using with native_path
r? @ChrisDenton