1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-26 19:11:46 +02:00

nar: 'write-file' can write to non-file ports.

* guix/nar.scm (write-contents): Use 'sendfile' only when P is a file
  port.
* tests/nar.scm ("write-file supports non-file output ports"): New test.
This commit is contained in:
Ludovic Courtès
2014-02-21 17:37:55 +01:00
parent 86d07a5514
commit a93e91ff48
2 changed files with 9 additions and 1 deletions
+7
View File
@@ -183,6 +183,13 @@
(test-begin "nar")
(test-assert "write-file supports non-file output ports"
(let ((input (string-append (dirname (search-path %load-path "guix.scm"))
"/guix"))
(output (%make-void-port "w")))
(write-file input output)
#t))
(test-assert "write-file + restore-file"
(let* ((input (string-append (dirname (search-path %load-path "guix.scm"))
"/guix"))