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

fs: Copy file permissions #2354

Merged

Conversation

kleimkuhler
Copy link
Contributor

File permissions are not properly copied by fs::copy.

This change ensures permissions are copied for new and existing files, as well
as adds a test.

Closes #2341

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
@kleimkuhler kleimkuhler self-assigned this Mar 30, 2020
@carllerche
Copy link
Member

Thanks for doing this 👍.

What if, instead of updating the source, we turn the entire fn into asyncify(|| std::fs::copy)?

@sfackler
Copy link
Contributor

I'd recommend doing that - there's a bunch of platform-specific stuff that the std version does that'd be a huge pain to maintain parity with.

Signed-off-by: Kevin Leimkuhler <kevin@kleimkuhler.com>
@LucioFranco LucioFranco merged commit 3eaa188 into tokio-rs:master Apr 2, 2020
hawkw added a commit that referenced this pull request Apr 4, 2020
# 0.2.16 (April 3, 2020)

### Fixes

- sync: fix a regression where `Mutex`, `Semaphore`, and `RwLock` futures no
  longer implement `Sync` (#2375)
- fs: fix `fs::copy` not copying file permissions (#2354)

### Added

- time: added `deadline` method to `delay_queue::Expired` (#2300)
- io: added `StreamReader` (#2052) 

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tokio::fs::copy sometimes not copying permissions?
4 participants