Skip to main content

Module host_jobs

Module host_jobs 

Source
Expand description

Copy and move between this computer and an SSH host, or within one host (spec §6.3 of SPEC_REMOTE_TERMINALS_AND_DURABLE_SESSIONS_2026_10_02.md): the same fs.op as a local copy, with the same progress, cancel and conflict questions (jobs::Jobs::start_host), the host’s side carried by its helper (remote::files).

  • A file goes to a temp file beside its destination, in pieces (ranged reads, appends), and is renamed into place only when complete, never over anything the user didn’t choose to replace.
  • A folder onto a folder merges; anything else already there is asked about (replace, skip, keep both).
  • Links aren’t copied between two machines: where one points means something only on its own side.
  • A move removes each source only once it landed; within one host it is a rename on that host.
  • Nothing in a protected place is changed: this computer’s rules (ProtectedPaths), a host’s system folders, root and home folder (remote::protected).

Structs§

Info 🔒
What a path is, on either side.
Item 🔒
One source to transfer, as planned.
Transfer 🔒

Enums§

End
One side of a transfer.
Outcome 🔒
What became of one entry.
RenameError 🔒
A rename that found its target taken.

Functions§

file_name 🔒
host_error 🔒
keep_both_name 🔒
name (n).ext for the first free n.
local_mode 🔒
A local entry’s Unix permission bits (0 elsewhere).
name_ok 🔒
Whether name is one plain name on a side (windows: this computer is Windows): never a path. A host’s names can hold \, : or ..\ that would mean other folders here, so whatever a host names is checked before it becomes a path on this computer.
open_source 🔒
A local source file, opened once: never through a link swapped in after it was checked, never stuck opening a pipe; whatever was opened must be a regular file.
plan_on_one_host 🔒
The local plan’s rules (jobs::plan) where source and destination are one host’s folders: a folder never into itself or a folder of its own; a move into the folder it is in is nothing to do, a copy there is a duplicate; and no destination lands on a folder holding another source. Between two machines none of this can happen. sources are (as given, resolved) pairs: the resolved one has its parent’s links resolved (Realpath), its own name kept, so a link to an ancestor isn’t taken for the ancestor; dest_dir is resolved too.
posix_join 🔒
name in dir, a host’s POSIX path.
posix_parent 🔒
The folder a host’s POSIX path is in; / at the top.
read_open 🔒
Up to len bytes from an open file, and whether it ends there.
realpath_now 🔒
path with its links resolved, awaited; as given when it can’t be.
start
Start a copy or move of sources (on src) into dest_dir (on dest) as an fs.op (emit carries its events). At least one side is a host.
stat_now 🔒
path’s entry on end, awaited (before the op’s thread exists).
under 🔒