-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
fs::copy on Windows has a 260 character filename limit #67403
Comments
|
One option might be to document this so it's a little bit less inexplicable to people who don't know the platform details. |
@retep998 The official Microsoft docs suggest doing what @jdm mentioned. The only exception I'm aware of is if it's a UNC then you need to use What kind of issues would this not address? |
Win32 has four types of absolute path:
It also has three types of relative path:
Rust's file system APIs would at least need to be internally consistent with how they handle all these paths. A smarter * I say "almost" because setting the Current Directory does not support verbatim paths. Only DOS and UNC paths are supported. |
This should hopefully be fixed in nightly by #89174, which is currently scheduled for the 1.58.0 release. |
It relies on the CopyFileExW Windows API, which has path limits that yield surprising runtime behaviour. We could opt in to longer path limits (32k instead of 260) by prepending
\?
to the string, according to that same documentation.The text was updated successfully, but these errors were encountered: