Added a private flag

This commit is contained in:
2026-08-09 14:16:18 +02:00
parent a9f1f9b7b6
commit f8349e9a11
5 changed files with 52 additions and 9 deletions
+10 -4
View File
@@ -41,8 +41,15 @@
)
)
(define (ini->file ini file)
(let ((out (open-output-file (get-ini-file file) #:exists 'replace)))
(define (ini->file ini file #:private? [private? #f])
(let* ((file (get-ini-file file))
(out (if (and private?
(memq (system-type 'os) '(unix macosx)))
(open-output-file file
#:exists 'replace
#:permissions #o600
#:replace-permissions? #t)
(open-output-file file #:exists 'replace))))
(let ((last-is-newline #f))
(for-each (lambda (section)
(let ((section-name (car section)))
@@ -74,10 +81,9 @@
(output-value (caddr line) out)
(newline out))
(error "Unknown line format")))))
lines))))
lines))))
(mcdr ini)))
(close-output-port out)))
(define (make-ini)
(mcons 'ini (list)))