Skip to main content

Module copy_into_dir

Module copy_into_dir 

Source
Expand description

The one “copy a file or folder into a directory” used by drag and drop, paste, and the attachment store’s copy-to-workdir. docs/specs/SPEC_DRAG_AND_DROP_CONSOLIDATION_2026_09_27.md §5.5.

Every destination is created exclusively (create_new, create_dir), so two copies of report.pdf land as report.pdf and report_1.pdf instead of racing for one name.

Structs§

CopyControl

Functions§

copy_into_dir
Copy src (a file, or a folder recursively) into dir under name made valid by copy_name and de-conflicted. Returns the path it landed at. Symlinks inside a copied folder are skipped, so a link loop can’t recurse. On error or cancel nothing is left behind.
copy_name
A source file name made valid as one path component on this platform, keeping everything that already is, dotfiles included.