From: Chris Hanson Date: Wed, 9 Oct 1996 15:44:46 +0000 (+0000) Subject: Now that microcode implements directory-reading properly, use the OS/2 X-Git-Tag: 20090517-FFI~5352 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=02e01868e14f7ca7dcccce7863cffcaa7754a24d;p=mit-scheme.git Now that microcode implements directory-reading properly, use the OS/2 directory reader for Win32. This is implemented by moving the directory reader to "dosfile.scm", since we aren't supporting DOS any more. --- diff --git a/v7/src/edwin/dos.scm b/v7/src/edwin/dos.scm index d693a1467..bd2e48589 100644 --- a/v7/src/edwin/dos.scm +++ b/v7/src/edwin/dos.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: dos.scm,v 1.39 1996/10/07 18:51:12 cph Exp $ +;;; $Id: dos.scm,v 1.40 1996/10/09 15:44:28 cph Exp $ ;;; ;;; Copyright (c) 1992-96 Massachusetts Institute of Technology ;;; @@ -61,20 +61,6 @@ ;; Not sure if this is right. (list "/c" command)) -(define (os/directory-list directory) - (os/directory-list-completions directory "")) - -(define (os/directory-list-completions directory prefix) - (let ((plen (string-length prefix))) - (let loop ((pathnames (directory-read (pathname-as-directory directory)))) - (if (null? pathnames) - '() - (let ((filename (file-namestring (car pathnames)))) - (if (and (fix:>= (string-length filename) plen) - (string-ci=? prefix (substring filename 0 plen))) - (cons filename (loop (cdr pathnames))) - (loop (cdr pathnames)))))))) - (define (os/set-file-modes-writable! pathname) (set-file-modes! pathname (fix:andc (file-modes pathname) nt-file-mode/read-only))) diff --git a/v7/src/edwin/dosfile.scm b/v7/src/edwin/dosfile.scm index d8ac432ae..6e19b0d80 100644 --- a/v7/src/edwin/dosfile.scm +++ b/v7/src/edwin/dosfile.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: dosfile.scm,v 1.7 1996/04/24 02:19:30 cph Exp $ +;;; $Id: dosfile.scm,v 1.8 1996/10/09 15:44:37 cph Exp $ ;;; ;;; Copyright (c) 1994-96 Massachusetts Institute of Technology ;;; @@ -122,6 +122,26 @@ Includes the new backup. Must be > 0." (string-set! result 0 #\$) result) filename))) + +(define (os/directory-list directory) + (let ((channel (directory-channel-open directory))) + (let loop ((result '())) + (let ((name (directory-channel-read channel))) + (if name + (loop (cons (begin (string-downcase! name) name) result)) + (begin + (directory-channel-close channel) + result)))))) + +(define (os/directory-list-completions directory prefix) + (let ((channel (directory-channel-open directory))) + (let loop ((result '())) + (let ((name (directory-channel-read-matching channel prefix))) + (if name + (loop (cons (begin (string-downcase! name) name) result)) + (begin + (directory-channel-close channel) + result)))))) ;;;; Backup and Auto-Save Filenames diff --git a/v7/src/edwin/os2.scm b/v7/src/edwin/os2.scm index 1d0047be1..a158d59e3 100644 --- a/v7/src/edwin/os2.scm +++ b/v7/src/edwin/os2.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: os2.scm,v 1.33 1996/10/02 17:00:22 cph Exp $ +;;; $Id: os2.scm,v 1.34 1996/10/09 15:44:46 cph Exp $ ;;; ;;; Copyright (c) 1994-96 Massachusetts Institute of Technology ;;; @@ -57,26 +57,6 @@ (define (os/form-shell-command command) (list "/c" command)) -(define (os/directory-list directory) - (let ((channel (directory-channel-open directory))) - (let loop ((result '())) - (let ((name (directory-channel-read channel))) - (if name - (loop (cons (begin (string-downcase! name) name) result)) - (begin - (directory-channel-close channel) - result)))))) - -(define (os/directory-list-completions directory prefix) - (let ((channel (directory-channel-open directory))) - (let loop ((result '())) - (let ((name (directory-channel-read-matching channel prefix))) - (if name - (loop (cons (begin (string-downcase! name) name) result)) - (begin - (directory-channel-close channel) - result)))))) - (define (os/set-file-modes-writable! pathname) (set-file-modes! pathname (fix:andc (file-modes pathname) os2-file-mode/read-only)))