Skip to content

std::fs::copy fails on NFS volumes on CentOS 7 #75387

Closed
@Gaelan

Description

@Gaelan

I tried this code:

// On a CentOS 7 VM, where the current directory is an NFS mount containing a file called "a" with any content
use std::fs;

fn main() {
  println!("Hello, world!");
  fs::copy("a", "b").unwrap();
}

I expected to see this happen: The file is successfully copied

Instead, this happened:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 95, kind: Other, message: "Operation not Supported" }', src/main.rs:4:4

Meta

rustc --version --verbose:

Screen Shot 2020-08-11 at 12 08 34 AM

Backtrace

Screen Shot 2020-08-11 at 12 10 16 AM Screen Shot 2020-08-11 at 12 10 56 AM Screen Shot 2020-08-11 at 12 11 59 AM

Apologies for screenshots, I'm running in a VM I can't easily copy/paste out of.

See also rust-lang/rustup#2452, which has a likely explanation of the cause of this.

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions