I've run into somewhat unexpected behavior and would like to know if someone already knows what this means.
In my program, at some point, I want to copy existing file into freshly created directory. When I use
std::fs::copy, like this:
it fails with "Operation not permitted (os error 1)". However, when I open two files and copy between them, like this:
let mut source = std::fs::File::open(&source)?; let mut target = std::fs::File::create(&target)?; std::io::copy(&mut source, &mut target)?;
it works. What might be the cause for this difference?