#| -*-Scheme-*-
-$Id: fileio.scm,v 1.35 2008/01/30 20:02:30 cph Exp $
+$Id: fileio.scm,v 1.36 2008/02/02 02:07:56 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
(define (open-input-file filename)
(let* ((pathname (merge-pathnames filename))
(channel (file-open-input-channel (->namestring pathname)))
- (port
- (make-port input-file-type
- (make-gstate channel #f 'TEXT 'TEXT pathname))))
+ (port (make-generic-i/o-port channel #f input-file-type pathname)))
(set-channel-port! channel port)
(port/set-line-ending port (file-line-ending pathname))
port))
(if (if (default-object? append?) #f append?)
(file-open-append-channel filename)
(file-open-output-channel filename))))
- (port
- (make-port output-file-type
- (make-gstate #f channel 'TEXT 'TEXT pathname))))
+ (port (make-generic-i/o-port #f channel output-file-type pathname)))
(set-channel-port! channel port)
(port/set-line-ending port (file-line-ending pathname))
port))
(define (open-i/o-file filename)
(let* ((pathname (merge-pathnames filename))
(channel (file-open-io-channel (->namestring pathname)))
- (port
- (make-port i/o-file-type
- (make-gstate channel channel 'TEXT 'TEXT pathname))))
+ (port (make-generic-i/o-port channel channel i/o-file-type pathname)))
(set-channel-port! channel port)
(port/set-line-ending port (file-line-ending pathname))
port))
(define (open-binary-input-file filename)
(let* ((pathname (merge-pathnames filename))
(channel (file-open-input-channel (->namestring pathname)))
- (port
- (make-port input-file-type
- (make-gstate channel #f 'BINARY 'BINARY pathname))))
+ (port (make-generic-i/o-port channel #f input-file-type pathname)))
(set-channel-port! channel port)
+ (port/set-coding port 'BINARY)
+ (port/set-line-ending port 'BINARY)
port))
(define (open-binary-output-file filename #!optional append?)
(if (if (default-object? append?) #f append?)
(file-open-append-channel filename)
(file-open-output-channel filename))))
- (port
- (make-port output-file-type
- (make-gstate #f channel 'BINARY 'BINARY pathname))))
+ (port (make-generic-i/o-port #f channel output-file-type pathname)))
(set-channel-port! channel port)
+ (port/set-coding port 'BINARY)
+ (port/set-line-ending port 'BINARY)
port))
(define (open-binary-i/o-file filename)
(let* ((pathname (merge-pathnames filename))
(channel (file-open-io-channel (->namestring pathname)))
- (port
- (make-port i/o-file-type
- (make-gstate channel channel 'BINARY 'BINARY pathname))))
+ (port (make-generic-i/o-port channel channel i/o-file-type pathname)))
(set-channel-port! channel port)
+ (port/set-coding port 'BINARY)
+ (port/set-line-ending port 'BINARY)
port))
\f
(define ((make-call-with-file open) input-specifier receiver)
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.633 2008/02/02 02:02:49 cph Exp $
+$Id: runtime.pkg,v 14.634 2008/02/02 02:07:58 cph Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
input-buffer-encoded-character-size
input-buffer-free-bytes
input-buffer-using-binary-normalizer?
- make-gstate
output-buffer-using-binary-denormalizer?
port-input-buffer
port-output-buffer)