rsh: add rcp, remote copy program

This commit is contained in:
2026-02-08 14:57:12 +02:00
parent 1012abceec
commit 4c5309fa15
34 changed files with 1118 additions and 95 deletions
+1 -1
View File
@@ -250,7 +250,7 @@ impl<T: GenericRxDescriptor> GenericRxRing<T> {
) -> Result<usize, Error> {
let mut inner = self.inner.lock();
while head.map_or(true, |tail| tail != inner.rd) {
while head.is_none_or(|tail| tail != inner.rd) {
let index = inner.rd % self.capacity;
inner.entries.cache_flush_element(index, false);
+3 -2
View File
@@ -312,7 +312,8 @@ impl IoContext {
let (dst_node, dst_name) = if let Ok(node) = self.find(dst_at.clone(), dst, false) {
// There is a node with the destination name, but it's not a directory
if !node.is_directory() {
return Err(Error::AlreadyExists);
node.parent().unlink_child(&node)?;
// return Err(Error::AlreadyExists);
}
// mv /a/b /c if /c exists -> move /a/b into /c with filename b
@@ -321,7 +322,7 @@ impl IoContext {
// Otherwise try looking up a parent
let node = self.find(dst_at, dst_parent, true)?;
if !node.is_directory() {
return Err(Error::NotADirectory);
node.parent().unlink_child(&node)?;
}
// mv /a/b /c/d if /c/d doesn't exist -> move /a/b into /c with filename d