jan/feature/20261017-lib-util-copy-support-filecontext-source-file-types-and-parents into master copy() can now land a single object at its source path, but the copy CLI command exposes no way to ask for it. Add a --parents flag forwarded to copy()'s parents argument. Signed-off-by: Jan Lindemann <jan@janware.com> Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
The walk needlessly descends into every directory node: A compound node is gettable as a whole, so copy it over and don't recurse deeper. Signed-off-by: Jan Lindemann <jan@janware.com>
copy() lands a source below the destination root, taking at most the source's basename, so there is no way to land it at its source path, as cp --parents does. Add a parents flag that requests just that. Signed-off-by: Jan Lindemann <jan@janware.com> Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
Using a FileContext, notably with its chroot flag set, is useful as a tree source in copy(), so allow it. Signed-off-by: Jan Lindemann <jan@janware.com> Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
The file type framework gives mkdir() and put() an ftype argument, but copy() calls them untyped, so the source's node types are discarded at the landing: a destination that applies its own node types receives only the defaults. This commit threads the source's types through. Signed-off-by: Jan Lindemann <jan@janware.com> Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.1.0
Refactor copy(), making the recursive logic more coherent: Every node the walk creates sits below a node that already exists, so a plain per-node mkdir() suffices and the chain- creating __mkdir_p() is dropped: the landing root's parent must exist now, as in cp -r. Signed-off-by: Jan Lindemann <jan@janware.com>
Give FileContext a read-only property to access self.__chroot, so a caller holding a context can predict whether the addresses it passes in are relative to the URI path or absolute. Signed-off-by: Jan Lindemann <jan@janware.com> Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.0.1
Analogous to the is_dir() method, add an is_gettable() method: The last commit introduces FT_COMPOUND, a file type which is a hybrid between directory and regular file. is_dir() succeeds on it, so is_gettable() symmetrically provides a test find out if get() also works on a file. Signed-off-by: Jan Lindemann <jan@janware.com>