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
+19
View File
@@ -0,0 +1,19 @@
#lang racket/base
(require rackunit
racket/file
"../main.rkt")
(define tmp (make-temporary-file "simple-ini-private-~a.ini"))
(dynamic-wind
void
(lambda ()
(define ini (make-ini))
(ini-set! ini 'secret 'token "abc")
(ini->file ini tmp #:private? #t)
(when (memq (system-type 'os) '(unix macosx))
(check-equal? (bitwise-and (file-or-directory-permissions tmp 'bits) #o777)
#o600)))
(lambda ()
(when (file-exists? tmp)
(delete-file tmp))))