Rollup merge of #43204 - jackpot51:patch-3, r=alexcrichton
Implement fs::rename in sys::redox This uses a simple implementation of copy + unlink. Redox does not have a rename or link system call for a faster implementation.
This commit is contained in:
commit
da3f5b80ed
1 changed files with 4 additions and 3 deletions
|
|
@ -383,9 +383,10 @@ pub fn unlink(p: &Path) -> io::Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn rename(_old: &Path, _new: &Path) -> io::Result<()> {
|
||||
::sys_common::util::dumb_print(format_args!("Rename\n"));
|
||||
unimplemented!();
|
||||
pub fn rename(old: &Path, new: &Path) -> io::Result<()> {
|
||||
copy(old, new)?;
|
||||
unlink(old)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn set_perm(p: &Path, perm: FilePermissions) -> io::Result<()> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue