diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/copy-file.tl | 13 | ||||
-rw-r--r-- | stdlib/doc-syms.tl | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/stdlib/copy-file.tl b/stdlib/copy-file.tl index 50408aca..beab2fbc 100644 --- a/stdlib/copy-file.tl +++ b/stdlib/copy-file.tl @@ -87,6 +87,19 @@ (skip `skip copying @path` (exc . args) (return)) (retry `retry copying @path` (exc . args)))))) +(defun cat-files (to-path . from-paths) + (let ((buf (make-buf copy-size))) + (with-stream (ost (open-file to-path "wb")) + (each ((from-path from-paths)) + (with-stream (ist (open-file from-path "b")) + (while (eql (len buf) copy-size) + (fill-buf-adjust buf 0 ist) + (put-buf buf 0 ost))) + (buf-set-length buf copy-size))) + (buf-set-length buf 0) + (buf-trim buf) + nil)) + (defun do-tweak-obj (to-path st opts link-p) (when (and opts.perms (not link-p)) (chmod to-path st.mode)) diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl index 754a0ae6..8a472752 100644 --- a/stdlib/doc-syms.tl +++ b/stdlib/doc-syms.tl @@ -269,6 +269,7 @@ ("casequal*" "N-02FB71A2") ("cases" "N-039458F2") ("cat" "N-03336E1B") + ("cat-files" "N-01249D65") ("cat-str" "N-00B6ACE3") ("cat-streams" "N-020BF082") ("cat-vec" "N-01AEB28B") |