mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-30 16:17:02 +01:00
gpgscm,w32: Provide schemish file handling for binary files.
* tests/gpgscm/lib.scm (call-with-binary-input-file): New function. (call-with-binary-output-file): Likewise. Signed-off-by: Justus Winter <justus@g10code.com>
This commit is contained in:
parent
6e677f9b55
commit
413cc50345
@ -186,6 +186,20 @@
|
||||
(write-char (apply read-char p) acc)
|
||||
(loop acc))))))
|
||||
|
||||
;;
|
||||
;; Windows support.
|
||||
;;
|
||||
|
||||
;; Like call-with-input-file but opens the file in 'binary' mode.
|
||||
(define (call-with-binary-input-file filename proc)
|
||||
(letfd ((fd (open filename (logior O_RDONLY O_BINARY))))
|
||||
(proc (fdopen fd "rb"))))
|
||||
|
||||
;; Like call-with-output-file but opens the file in 'binary' mode.
|
||||
(define (call-with-binary-output-file filename proc)
|
||||
(letfd ((fd (open filename (logior O_WRONLY O_CREAT O_BINARY) #o600)))
|
||||
(proc (fdopen fd "wb"))))
|
||||
|
||||
;;
|
||||
;; Libc functions.
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user