/usr/lib/s9fes/append-to-output-file.scm is in scheme9 2010.11.13-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2010
; See the LICENSE file of the S9fES package for terms of use
;
; (append-to-output-file string) ==> output-port
;
; Take a string naming an output file and return an output port
; capable of writing characters to the that file. Characters
; written to the port will be appended to the file. When the
; file does not exist when this procedure is called, it will
; be created. If the file cannot be opened, an error is signalled.
;
; (Example): (append-to-output-file "logfile") ==> #<output-port>
(require-extension sys-unix)
(define (append-to-output-file path)
(let ((fd (if (file-exists? path)
(sys:open path sys:write-only)
(sys:creat path #o644))))
(sys:lseek fd 0 sys:seek-end)
(sys:make-output-port fd)))
|