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

std::fs::copy is unsupported #4183

Open
anatawa12 opened this issue Feb 7, 2025 · 2 comments
Open

std::fs::copy is unsupported #4183

anatawa12 opened this issue Feb 7, 2025 · 2 comments
Labels
A-files Area: related to files, paths, sockets, file descriptors, or handles A-linux Area: affects only Linux targets A-mac Area: Affects only macOS targets A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement

Comments

@anatawa12
Copy link

When we call std::fs::copy on macos, we encountered unsupported operation: can't call foreign function `fclonefileat` on OS `macos` error.

I think std::fs::copy is a basic API commonly used so I reported here as miri error message suggests.

I searched for fclonefileat but I could not found existing issue

@RalfJung RalfJung changed the title fclonefileat unsupported operation on macos with std::fs::copy std::fs::copy unsupported operation on macos: needs fclonefileat Feb 7, 2025
@RalfJung
Copy link
Member

RalfJung commented Feb 7, 2025

Thanks for the report!

Yes it would be reasonable to support this; no idea how tricky it would be though. I don't think we support fs::copy on any OS so far, so implementing it on Linux would likely be the first step.

@RalfJung RalfJung changed the title std::fs::copy unsupported operation on macos: needs fclonefileat std::fs::copy is unsupported Feb 7, 2025
@RalfJung
Copy link
Member

RalfJung commented Feb 7, 2025

Looks like on Linux,fs::copy falls back to io::copy, so this might already work.

@RalfJung RalfJung added A-shims Area: This affects the external function shims A-mac Area: Affects only macOS targets A-linux Area: affects only Linux targets A-files Area: related to files, paths, sockets, file descriptors, or handles C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-files Area: related to files, paths, sockets, file descriptors, or handles A-linux Area: affects only Linux targets A-mac Area: Affects only macOS targets A-shims Area: This affects the external function shims C-enhancement Category: a PR with an enhancement or an issue tracking an accepted enhancement
Projects
None yet
Development

No branches or pull requests

2 participants