;;;; Test the BLOWFISH option.
(let ((sample "Some text to encrypt and decrypt."))
- (call-with-binary-output-file "test"
+ (call-with-legacy-binary-output-file "test"
(lambda (output)
(call-with-input-string sample
(lambda (input)
(write-blowfish-file-header output)
#t)))))
(let ((read-back
- (call-with-binary-input-file "test"
+ (call-with-legacy-binary-input-file "test"
(lambda (input)
(call-with-output-string
(lambda (output)
(error:bad-range-argument port 'READ-BLOWFISH-FILE-HEADER)))))
(define (blowfish-file? pathname)
- (let ((line (call-with-binary-input-file pathname read-line)))
+ (let ((line (call-with-legacy-binary-input-file pathname read-line)))
(and (not (eof-object? line))
(or (string=? line blowfish-file-header-v1)
(string=? line blowfish-file-header-v2)))))
output
permanent))
(set-string-length! *doc-strings* *doc-string-posn*)
- (call-with-binary-output-file
+ (call-with-legacy-binary-output-file
output
(lambda (port)
(output-port/write-string port *doc-strings*)))
" already exists; overwrite")))
(begin
((if binary-plaintext?
- call-with-binary-input-file
+ call-with-legacy-binary-input-file
call-with-input-file)
from
(lambda (input)
" already exists; overwrite")))
(begin
((if binary-plaintext?
- call-with-binary-output-file
+ call-with-legacy-binary-output-file
call-with-output-file)
to
(lambda (output)
#t)))
(define (%blowfish-encrypt-file pathname input)
- (call-with-binary-output-file pathname
+ (call-with-legacy-binary-output-file pathname
(lambda (output)
(call-with-sensitive-string (call-with-confirmed-pass-phrase md5-string)
(lambda (key-string)
#t))))))
(define (%blowfish-decrypt-file pathname output)
- (call-with-binary-input-file pathname
+ (call-with-legacy-binary-input-file pathname
(lambda (input)
(call-with-sensitive-string
(call-with-pass-phrase "Pass phrase" md5-string)
(let ((context (initialize port text?)))
((if (eq? type 'TEXT)
call-with-input-file
- call-with-binary-input-file)
+ call-with-legacy-binary-input-file)
(mime-attachment-pathname attachment)
(lambda (input-port)
(let ((buffer (make-string 4096)))
(define-method create-file-folder-file (url (type <rmail-folder-type>))
type
- (call-with-binary-output-file (pathname-url-pathname url)
+ (call-with-legacy-binary-output-file (pathname-url-pathname url)
(lambda (port)
(write-rmail-file-header (make-rmail-folder-header-fields '()) port))))
;;;; Write RMAIL file
(define-method write-file-folder ((folder <rmail-folder>) pathname)
- (call-with-binary-output-file pathname
+ (call-with-legacy-binary-output-file pathname
(lambda (port)
(write-rmail-file-header (rmail-folder-header-fields folder) port)
(for-each-vector-element (file-folder-messages folder)
(define-method append-message-to-file (message url (type <rmail-folder-type>))
type
- (call-with-binary-append-file (pathname-url-pathname url)
+ (call-with-legacy-binary-append-file (pathname-url-pathname url)
(lambda (port)
(write-rmail-message message port))))
(eq? type 'MESSAGE)))))
(if (or (not (file-exists? filename))
(prompt-for-yes-or-no? "File already exists; overwrite"))
- ((if text? call-with-output-file call-with-binary-output-file)
+ ((if text? call-with-output-file call-with-legacy-binary-output-file)
filename
(lambda (port)
(call-with-mime-decoding-output-port
(define-method create-file-folder-file (url (type <umail-folder-type>))
type
- (call-with-binary-output-file (pathname-url-pathname url)
+ (call-with-legacy-binary-output-file (pathname-url-pathname url)
(lambda (port)
port
unspecific)))
;;;; Write unix mail file
(define-method write-file-folder ((folder <umail-folder>) pathname)
- (call-with-binary-output-file pathname
+ (call-with-legacy-binary-output-file pathname
(lambda (port)
(for-each-vector-element (file-folder-messages folder)
(lambda (message)
(define-method append-message-to-file (message url (type <umail-folder-type>))
type
- (call-with-binary-append-file (pathname-url-pathname url)
+ (call-with-legacy-binary-append-file (pathname-url-pathname url)
(lambda (port)
(write-umail-message message #t port))))
;;;; Extended-string input port
(define (read-file-into-xstring pathname)
- (call-with-binary-input-file pathname
+ (call-with-legacy-binary-input-file pathname
(lambda (port)
(let ((n-bytes ((port/operation port 'LENGTH) port)))
(let ((xstring (make-string n-bytes)))
result))
(define (md5-file filename)
- (call-with-binary-input-file filename
+ (call-with-legacy-binary-input-file filename
(lambda (port)
(let ((buffer (make-string 4096))
(context (%md5-init)))
unspecific)
(define (mhash-file hash-type filename)
- (call-with-binary-input-file filename
+ (call-with-legacy-binary-input-file filename
(lambda (port)
(let ((buffer (make-string 4096))
(context (mhash-init hash-type)))
(error:bad-range-argument port 'READ-BLOWFISH-FILE-HEADER)))))
(define (blowfish-file? pathname)
- (let ((line (call-with-binary-input-file pathname read-line)))
+ (let ((line (call-with-legacy-binary-input-file pathname read-line)))
(and (not (eof-object? line))
(or (string=? line blowfish-file-header-v1)
(string=? line blowfish-file-header-v2)))))
;;; determines the algorithm.
\f
(define (compress ifile ofile)
- (call-with-binary-input-file (merge-pathnames ifile)
+ (call-with-legacy-binary-input-file (merge-pathnames ifile)
(lambda (input)
- (call-with-binary-output-file (merge-pathnames ofile)
+ (call-with-legacy-binary-output-file (merge-pathnames ofile)
(lambda (output)
(write-string "Compressed-B1-1.00" output)
(compress-ports input output))))))
unspecific)
(define (mhash-file hash-type filename)
- (call-with-binary-input-file filename
+ (call-with-legacy-binary-input-file filename
(lambda (port)
(let ((buffer (make-string 4096))
(context (mhash-init hash-type)))
(error "This Scheme system was built without MD5 support."))))
(define (%md5-file filename)
- (call-with-binary-input-file filename
+ (call-with-legacy-binary-input-file filename
(lambda (port)
(let ((buffer (make-string 4096))
(context ((ucode-primitive md5-init 0))))
(port/set-line-ending port (file-line-ending pathname))
port))
-(define (open-binary-input-file filename)
+(define (open-legacy-binary-input-file filename)
(let* ((pathname (merge-pathnames filename))
(channel (file-open-input-channel (->namestring pathname)))
(port (make-generic-i/o-port channel #f input-file-type pathname)))
(port/set-line-ending port 'BINARY)
port))
-(define (open-binary-output-file filename #!optional append?)
+(define (open-legacy-binary-output-file filename #!optional append?)
(let* ((pathname (merge-pathnames filename))
(channel
(let ((filename (->namestring pathname)))
(port/set-line-ending port 'BINARY)
port))
-(define (open-exclusive-binary-output-file filename)
+(define (open-exclusive-legacy-binary-output-file filename)
(let* ((pathname (merge-pathnames filename))
(channel (file-open-exclusive-output-channel (->namestring pathname)))
(port (make-generic-i/o-port #f channel output-file-type pathname)))
(port/set-line-ending port 'BINARY)
port))
-(define (open-binary-i/o-file filename)
+(define (open-legacy-binary-i/o-file filename)
(let* ((pathname (merge-pathnames filename))
(channel (file-open-io-channel (->namestring pathname)))
(port (make-generic-i/o-port channel channel i/o-file-type pathname)))
(define call-with-input-file
(make-call-with-file open-input-file))
-(define call-with-binary-input-file
- (make-call-with-file open-binary-input-file))
+(define call-with-legacy-binary-input-file
+ (make-call-with-file open-legacy-binary-input-file))
(define call-with-output-file
(make-call-with-file open-output-file))
(define call-with-exclusive-output-file
(make-call-with-file open-exclusive-output-file))
-(define call-with-binary-output-file
- (make-call-with-file open-binary-output-file))
+(define call-with-legacy-binary-output-file
+ (make-call-with-file open-legacy-binary-output-file))
-(define call-with-exclusive-binary-output-file
- (make-call-with-file open-exclusive-binary-output-file))
+(define call-with-exclusive-legacy-binary-output-file
+ (make-call-with-file open-exclusive-legacy-binary-output-file))
(define call-with-append-file
(make-call-with-file (lambda (filename) (open-output-file filename #t))))
-(define call-with-binary-append-file
+(define call-with-legacy-binary-append-file
(make-call-with-file
- (lambda (filename) (open-binary-output-file filename #t))))
+ (lambda (filename) (open-legacy-binary-output-file filename #t))))
(define ((make-with-input-from-file call) input-specifier thunk)
(call input-specifier
(make-with-input-from-file call-with-input-file))
(define with-input-from-binary-file
- (make-with-input-from-file call-with-binary-input-file))
+ (make-with-input-from-file call-with-legacy-binary-input-file))
(define ((make-with-output-to-file call) output-specifier thunk)
(call output-specifier
(make-with-output-to-file call-with-exclusive-output-file))
(define with-output-to-binary-file
- (make-with-output-to-file call-with-binary-output-file))
+ (make-with-output-to-file call-with-legacy-binary-output-file))
-(define with-output-to-exclusive-binary-file
- (make-with-output-to-file call-with-exclusive-binary-output-file))
\ No newline at end of file
+(define with-output-to-exclusive-legacy-binary-file
+ (make-with-output-to-file call-with-exclusive-legacy-binary-output-file))
\ No newline at end of file
(fasload-loader temporary-file))))))
(define (uncompress-internal ifile ofile if-fail)
- (call-with-binary-input-file (merge-pathnames ifile)
+ (call-with-legacy-binary-input-file (merge-pathnames ifile)
(lambda (input)
(let* ((file-marker "Compressed-B1-1.00")
(marker-size (string-length file-marker))
actual-marker 0 marker-size)
marker-size)
(string=? file-marker actual-marker))
- (call-with-binary-output-file (merge-pathnames ofile)
- (lambda (output)
+ (call-with-legacy-binary-output-file (merge-pathnames ofile)
+ (lambda (output)
(uncompress-ports input output (fix:* (file-length ifile) 2))))
(if-fail "Not a recognized compressed file:" ifile))))))
\ No newline at end of file
\f
(define (fasl-file? pathname)
(and (file-regular? pathname)
- (call-with-binary-input-file pathname
+ (call-with-legacy-binary-input-file pathname
(lambda (port)
(let ((n (vector-ref (gc-space-status) 0)))
(let ((marker (make-string n)))
guarantee-string
guarantee-string-index
guarantee-xstring
+ legacy-string?
;; END deprecated bindings
(set-vector-8b-length! set-string-length!)
(vector-8b-length string-length)
guarantee-substring-end-index
guarantee-substring-start-index
hexadecimal->vector-8b
- legacy-string?
lisp-string->camel-case
list->string
make-string
(files "bytevector")
(parent (runtime))
(export ()
+ ;; BEGIN deprecated bindings
+ legacy-string->bytevector
+ ;; END deprecated bindings
byte?
bytevector
bytevector-append
bytevector-u8-set!
bytevector=?
bytevector?
- legacy-string->bytevector
make-bytevector
string->utf8
utf8->string))
(parent (runtime))
(export ()
;; BEGIN deprecated bindings
+ call-with-exclusive-legacy-binary-output-file
+ call-with-legacy-binary-append-file
+ call-with-legacy-binary-input-file
+ call-with-legacy-binary-output-file
+ open-exclusive-legacy-binary-output-file
+ open-legacy-binary-i/o-file
+ open-legacy-binary-input-file
+ open-legacy-binary-output-file
with-input-from-binary-file
with-output-to-binary-file
+ with-output-to-exclusive-legacy-binary-file
;; END deprecated bindings
call-with-append-file
- call-with-binary-append-file
- call-with-binary-input-file
- call-with-binary-output-file
- call-with-exclusive-binary-output-file
call-with-exclusive-output-file
call-with-input-file
call-with-output-file
- open-binary-i/o-file
- open-binary-input-file
- open-binary-output-file
- open-exclusive-binary-output-file
open-exclusive-output-file
open-i/o-file
open-input-file
open-output-file
with-input-from-file
- with-output-to-exclusive-binary-file
with-output-to-exclusive-file
with-output-to-file)
(initialization (initialize-package!)))