Added a private flag
This commit is contained in:
@@ -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)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user