fix file functions that require a keyword argument

svn: r8879
This commit is contained in:
Eli Barzilay 2008-03-04 18:57:25 +00:00
parent b2688fb9b3
commit c51b8f1b1b

View File

@ -205,15 +205,14 @@ Various common pieces of code that both the client and server need to access
;; saves the given table, overwriting any file that might be there ;; saves the given table, overwriting any file that might be there
(define (save-hard-link-table table) (define (save-hard-link-table table)
(verify-well-formed-hard-link-parameter!) (verify-well-formed-hard-link-parameter!)
(with-output-to-file (HARD-LINK-FILE) (with-output-to-file (HARD-LINK-FILE) #:exists 'truncate
(lambda () (lambda ()
(display "") (display "")
(for-each (for-each
(lambda (row) (lambda (row)
(write (update-element 4 path->bytes row)) (write (update-element 4 path->bytes row))
(newline)) (newline))
table)) table))))
'truncate))
;; add-hard-link! string (listof string) num num path -> void ;; add-hard-link! string (listof string) num num path -> void
;; adds the given hard link, clearing any previous ones already in place ;; adds the given hard link, clearing any previous ones already in place
@ -425,7 +424,7 @@ Various common pieces of code that both the client and server need to access
; copies exactly n chars to the given file from the given port. Raises an exception ; copies exactly n chars to the given file from the given port. Raises an exception
; if the given number of characters are not available. ; if the given number of characters are not available.
(define (read-n-chars-to-file n ip file) (define (read-n-chars-to-file n ip file)
(let ((op (open-output-file file 'truncate))) (let ((op (open-output-file file #:exists 'truncate)))
(copy-n-chars n ip op) (copy-n-chars n ip op)
(close-output-port op))) (close-output-port op)))
@ -487,7 +486,7 @@ Various common pieces of code that both the client and server need to access
(outport (outport
(if logfile (if logfile
(with-handlers ((exn:fail:filesystem? (lambda (e) null-out))) (with-handlers ((exn:fail:filesystem? (lambda (e) null-out)))
(open-output-file logfile 'append)) (open-output-file logfile #:exists 'append))
null-out))) null-out)))
(parameterize ([current-output-port outport]) (parameterize ([current-output-port outport])
(f)))) (f))))