mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
e38b24ea4c
commit
b2bb501ebc
1 changed files with 2 additions and 2 deletions
|
|
@ -258,14 +258,14 @@ async fn _copy_with_progress(from: PathBuf, to: PathBuf, cha: Cha) -> io::Result
|
||||||
tokio::task::spawn_blocking(move || {
|
tokio::task::spawn_blocking(move || {
|
||||||
let mut reader = std::fs::File::open(from)?;
|
let mut reader = std::fs::File::open(from)?;
|
||||||
let mut writer = std::fs::OpenOptions::new()
|
let mut writer = std::fs::OpenOptions::new()
|
||||||
.mode(cha.perm as u32)
|
.mode(cha.mode as u32)
|
||||||
.write(true)
|
.write(true)
|
||||||
.create(true)
|
.create(true)
|
||||||
.truncate(true)
|
.truncate(true)
|
||||||
.open(to)?;
|
.open(to)?;
|
||||||
|
|
||||||
let written = std::io::copy(&mut reader, &mut writer)?;
|
let written = std::io::copy(&mut reader, &mut writer)?;
|
||||||
unsafe { libc::fchmod(writer.as_raw_fd(), cha.perm) };
|
unsafe { libc::fchmod(writer.as_raw_fd(), cha.mode) };
|
||||||
writer.set_times(ft).ok();
|
writer.set_times(ft).ok();
|
||||||
|
|
||||||
Ok(written)
|
Ok(written)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue